]> Kevux Git Server - fll/commitdiff
Security: Check if 'main' is NULL.
authorKevin Day <thekevinday@gmail.com>
Sun, 25 Dec 2022 01:34:40 +0000 (19:34 -0600)
committerKevin Day <thekevinday@gmail.com>
Sun, 25 Dec 2022 01:34:40 +0000 (19:34 -0600)
level_3/control/c/control.c
level_3/control/c/control.h
level_3/controller/c/controller.c
level_3/controller/c/controller.h

index 4958d1c36530de34fd6a21b658f20a641a64f61b..5b57bcd6eef9b648fab1647a34a6144804a8565d 100644 (file)
@@ -10,6 +10,8 @@ extern "C" {
 #ifndef _di_control_print_help_
   f_status_t control_print_help(const fll_program_data_t * const main) {
 
+    if (!main) return F_output_not;
+
     flockfile(main->output.to.stream);
 
     fll_program_print_help_header(main->output.to, main->context, control_program_name_long_s, control_program_version_s);
index c218b00d135f4e8ba3ad5aa1d48ae2b245adf303..2d4f23a39d861f10dc24dc846a24545cedf14159 100644 (file)
@@ -65,6 +65,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  *
  * @see control_main()
  */
index 500f7ddaa92bc2681c45bc4f4280a232ffdcf2c5..a88cda612d458a0d17c9a588224ef78d34df8ca7 100644 (file)
@@ -15,6 +15,8 @@ extern "C" {
 #ifndef _di_controller_print_help_
   f_status_t controller_print_help(controller_main_t * const main) {
 
+    if (!main) return F_output_not;
+
     controller_lock_print(main->output.to, 0);
 
     fll_program_print_help_header(main->output.to, main->context, *main->program_name_long, controller_program_version_s);
index e30842a65b21bbdc47c24b6c86d7b08c4c6b63ae..69c5971322f1ce73f6f65af4409e5ae38fba2111 100644 (file)
@@ -91,6 +91,7 @@ extern "C" {
  *
  * @return
  *   F_none on success.
+ *   F_output_not on success, but no printing is performed.
  *
  * @see controller_main()
  */