]> Kevux Git Server - fll/commitdiff
Regression: Make sure setting.path_pid is NULL terminated.
authorKevin Day <thekevinday@gmail.com>
Fri, 11 Feb 2022 23:22:23 +0000 (17:22 -0600)
committerKevin Day <thekevinday@gmail.com>
Fri, 11 Feb 2022 23:22:23 +0000 (17:22 -0600)
The libc path functions end up accessing this string.
The libc functions require NULL terminated strings.

level_3/controller/c/controller.c

index 3cba463b9a121b988a3914d0665fdd289f76dd88..410d307aec99841a48be3e4b951c0ae0715f4cb6 100644 (file)
@@ -308,6 +308,13 @@ extern "C" {
       if (F_status_is_error(status)) {
         fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
       }
+      else {
+        status = f_string_dynamic_terminate_after(&setting.path_pid);
+
+        if (F_status_is_error(status)) {
+          fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
+        }
+      }
     }
 
     if (F_status_is_error_not(status)) {