]> Kevux Git Server - fll/commitdiff
Security: Check if either 'main' or 'setting' is NULL.
authorKevin Day <thekevinday@gmail.com>
Sun, 25 Dec 2022 02:00:05 +0000 (20:00 -0600)
committerKevin Day <thekevinday@gmail.com>
Sun, 25 Dec 2022 02:00:05 +0000 (20:00 -0600)
Name the void pointer 'setting' as 'void_setting' for consistency purposes.
Note that this should not be named 'void_setting' in the header files.

level_3/fss_write/c/basic/fss_write.c
level_3/fss_write/c/basic_list/fss_write.c
level_3/fss_write/c/embedded_list/fss_write.c
level_3/fss_write/c/extended/fss_write.c
level_3/fss_write/c/extended_list/fss_write.c
level_3/fss_write/c/main/fss_write.c
level_3/fss_write/c/main/main.c
level_3/fss_write/c/payload/fss_write.c

index 12c89751a553a3b3046d13748a59325614f4649e..78e7332481279c3c7426f407f713ed1590c3254c 100644 (file)
@@ -8,6 +8,8 @@ extern "C" {
 #ifndef _di_fss_write_basic_process_content_
   void fss_write_basic_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
 
+    if (!main || !void_setting) return;
+
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->content) {
@@ -51,15 +53,19 @@ extern "C" {
 #endif // _di_fss_write_basic_process_content_
 
 #ifndef _di_fss_write_basic_process_help_
-  void fss_write_basic_process_help(fll_program_data_t * const main, void * const setting) {
+  void fss_write_basic_process_help(fll_program_data_t * const main, void * const void_setting) {
+
+    if (!main || !void_setting) return;
 
-    fss_write_basic_print_help(setting, main->message);
+    fss_write_basic_print_help(void_setting, main->message);
   }
 #endif // _di_fss_write_basic_process_help_
 
 #ifndef _di_fss_write_basic_process_object_
   void fss_write_basic_process_object(fll_program_data_t * const main, void * const void_setting) {
 
+    if (!main || !void_setting) return;
+
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
index f80dac2d5b87b3ba327a25deca30b2bc3c45cca1..38d636b039588609d3647d9f8d71d124f6d33882 100644 (file)
@@ -8,6 +8,8 @@ extern "C" {
 #ifndef _di_fss_write_basic_list_process_content_
   void fss_write_basic_list_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
 
+    if (!main || !void_setting) return;
+
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->content) {
@@ -54,15 +56,19 @@ extern "C" {
 #endif // _di_fss_write_basic_list_process_content_
 
 #ifndef _di_fss_write_basic_list_process_help_
-  void fss_write_basic_list_process_help(fll_program_data_t * const main, void * const setting) {
+  void fss_write_basic_list_process_help(fll_program_data_t * const main, void * const void_setting) {
+
+    if (!main || !void_setting) return;
 
-    fss_write_basic_list_print_help(setting, main->message);
+    fss_write_basic_list_print_help(void_setting, main->message);
   }
 #endif // _di_fss_write_basic_list_process_help_
 
 #ifndef _di_fss_write_basic_list_process_object_
   void fss_write_basic_list_process_object(fll_program_data_t * const main, void * const void_setting) {
 
+    if (!main || !void_setting) return;
+
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
index 543661d1fbefa0a1a7b73c4887eb1c366593f838..9978353e60ce60c06d386710b4037e76a3d1da1b 100644 (file)
@@ -8,6 +8,8 @@ extern "C" {
 #ifndef _di_fss_write_embedded_list_process_content_
   void fss_write_embedded_list_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
 
+    if (!main || !void_setting) return;
+
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->content) {
@@ -59,15 +61,19 @@ extern "C" {
 #endif // _di_fss_write_embedded_list_process_content_
 
 #ifndef _di_fss_write_embedded_list_process_help_
-  void fss_write_embedded_list_process_help(fll_program_data_t * const main, void * const setting) {
+  void fss_write_embedded_list_process_help(fll_program_data_t * const main, void * const void_setting) {
+
+    if (!main || !void_setting) return;
 
-    fss_write_embedded_list_print_help(setting, main->message);
+    fss_write_embedded_list_print_help(void_setting, main->message);
   }
 #endif // _di_fss_write_embedded_list_process_help_
 
 #ifndef _di_fss_write_embedded_list_process_object_
   void fss_write_embedded_list_process_object(fll_program_data_t * const main, void * const void_setting) {
 
+    if (!main || !void_setting) return;
+
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
index 86ec2424989bf832068229c92fd035145da2fef9..15b2cfae17664e5138e56fe60bc517b37f1b6096 100644 (file)
@@ -8,6 +8,8 @@ extern "C" {
 #ifndef _di_fss_write_extended_process_content_
   void fss_write_extended_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
 
+    if (!main || !void_setting) return;
+
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->content) {
@@ -63,15 +65,19 @@ extern "C" {
 #endif // _di_fss_write_extended_process_content_
 
 #ifndef _di_fss_write_extended_process_help_
-  void fss_write_extended_process_help(fll_program_data_t * const main, void * const setting) {
+  void fss_write_extended_process_help(fll_program_data_t * const main, void * const void_setting) {
+
+    if (!main || !void_setting) return;
 
-    fss_write_extended_print_help(setting, main->message);
+    fss_write_extended_print_help(void_setting, main->message);
   }
 #endif // _di_fss_write_extended_process_help_
 
 #ifndef _di_fss_write_extended_process_object_
   void fss_write_extended_process_object(fll_program_data_t * const main, void * const void_setting) {
 
+    if (!main || !void_setting) return;
+
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
index 1496c2fb27e944b64c98edc4247bddafc55a3bf4..e905ce3859702893e308368d19e38b1ce9cbbff0 100644 (file)
@@ -8,6 +8,8 @@ extern "C" {
 #ifndef _di_fss_write_extended_list_process_content_
   void fss_write_extended_list_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
 
+    if (!main || !void_setting) return;
+
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->content) {
@@ -59,15 +61,19 @@ extern "C" {
 #endif // _di_fss_write_extended_list_process_content_
 
 #ifndef _di_fss_write_extended_list_process_help_
-  void fss_write_extended_list_process_help(fll_program_data_t * const main, void * const setting) {
+  void fss_write_extended_list_process_help(fll_program_data_t * const main, void * const void_setting) {
+
+    if (!main || !void_setting) return;
 
-    fss_write_extended_list_print_help(macro_fss_write_setting(setting), main->message);
+    fss_write_extended_list_print_help(macro_fss_write_setting(void_setting), main->message);
   }
 #endif // _di_fss_write_extended_list_process_help_
 
 #ifndef _di_fss_write_extended_list_process_object_
   void fss_write_extended_list_process_object(fll_program_data_t * const main, void * const void_setting) {
 
+    if (!main || !void_setting) return;
+
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if (setting->object) {
index a07d92f695a6a8410623151c0774a39b6e0a25aa..4ba95373880063545afaeb561642e3eccc26c96d 100644 (file)
@@ -47,14 +47,14 @@ extern "C" {
 #endif // _di_fss_write_main_
 
 #ifndef _di_fss_write_process_normal_
-  void fss_write_process_normal(fll_program_data_t * const main, void * const setting) {
+  void fss_write_process_normal(fll_program_data_t * const main, void * const void_setting) {
 
     fss_write_process_normal_data(
       main,
-      macro_fss_write_setting(setting),
-      (macro_fss_write_setting(setting)->flag & fss_write_flag_object_e)
-        ? macro_fss_write_setting(setting)->objects.used
-        : macro_fss_write_setting(setting)->contentss.used
+      macro_fss_write_setting(void_setting),
+      (macro_fss_write_setting(void_setting)->flag & fss_write_flag_object_e)
+        ? macro_fss_write_setting(void_setting)->objects.used
+        : macro_fss_write_setting(void_setting)->contentss.used
     );
   }
 #endif // _di_fss_write_process_normal_
index 367f2cd2fd098aa241e893d54683091cc9a25362..832854e737012bb237f20d220838037b40771328 100644 (file)
@@ -43,9 +43,11 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
 }
 
 #ifndef _di_fss_write_main_process_help_
-  void fss_write_main_process_help(fll_program_data_t * const main, void * const setting) {
+  void fss_write_main_process_help(fll_program_data_t * const main, void * const void_setting) {
 
-    fss_write_main_print_help(macro_fss_write_setting(setting), main->message);
+    if (!main || !void_setting) return;
+
+    fss_write_main_print_help(macro_fss_write_setting(void_setting), main->message);
   }
 #endif // _di_fss_write_main_process_help_
 
index 024b3f66ea977542ef9437c1e4e333303fdb6c19..cc0505643f5bb2fd7552c52c0ab3a6b58e9823c7 100644 (file)
@@ -6,15 +6,19 @@ extern "C" {
 #endif
 
 #ifndef _di_fss_write_payload_process_help_
-  void fss_write_payload_process_help(fll_program_data_t * const main, void * const setting) {
+  void fss_write_payload_process_help(fll_program_data_t * const main, void * const void_setting) {
 
-    fss_write_payload_print_help(macro_fss_write_setting(setting), main->message);
+    if (!main || !void_setting) return;
+
+    fss_write_payload_print_help(macro_fss_write_setting(void_setting), main->message);
   }
 #endif // _di_fss_write_payload_process_help_
 
 #ifndef _di_fss_write_payload_process_pipe_
   void fss_write_payload_process_pipe(fll_program_data_t * const main, void * const void_setting) {
 
+    if (!main || !void_setting) return;
+
     f_status_t status_pipe = F_none;
     f_file_t input = f_file_t_initialize;
     input.id = F_type_descriptor_input_d;
@@ -376,6 +380,8 @@ extern "C" {
 #ifndef _di_fss_write_payload_process_set_
   void fss_write_payload_process_set(fll_program_data_t * const main, void * const void_setting) {
 
+    if (!main || !void_setting) return;
+
     fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
 
     if ((!(setting->flag & fss_write_flag_partial_e) || (setting->flag & fss_write_flag_partial_e) && (setting->flag & fss_write_flag_object_e))) {