From 10794c11ada096cda2255d2bdd4ff7d0fdc9f480 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 11 Feb 2022 17:22:23 -0600 Subject: [PATCH] Regression: Make sure setting.path_pid is NULL terminated. The libc path functions end up accessing this string. The libc functions require NULL terminated strings. --- level_3/controller/c/controller.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/level_3/controller/c/controller.c b/level_3/controller/c/controller.c index 3cba463..410d307 100644 --- a/level_3/controller/c/controller.c +++ b/level_3/controller/c/controller.c @@ -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)) { -- 1.8.3.1