From 6ae1888d74a1c9ce86ff9abb6662ea4b1b23fb25 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 7 Aug 2023 20:02:45 -0500 Subject: [PATCH] Regression: Incorrect type on memset() in array resulting in invalid read. The particular problematic array is an array of f_string_t and not and array of f_char_t. This is the opposite of the regression that is fixed in commit 3533e7f840c5d852f98372f2dd9c9066cc53c85e. --- level_2/fll_execute/c/private-execute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/level_2/fll_execute/c/private-execute.c b/level_2/fll_execute/c/private-execute.c index f834dc7..7fcc9d1 100644 --- a/level_2/fll_execute/c/private-execute.c +++ b/level_2/fll_execute/c/private-execute.c @@ -553,7 +553,7 @@ extern "C" { void private_fll_execute_path_arguments_fixate(const f_string_static_t program_path, const f_string_statics_t arguments, const f_string_t last_slash, const bool fixated_is, f_string_static_t program_name, f_string_t fixed_arguments[]) { memset(program_name.string, 0, sizeof(f_char_t) * (program_name.used + 1)); - memset(fixed_arguments, 0, sizeof(f_char_t) * (arguments.used + 2)); + memset(fixed_arguments, 0, sizeof(f_string_t) * (arguments.used + 2)); memcpy(program_name.string, last_slash ? last_slash + 1 : program_path.string, sizeof(f_char_t) * program_name.used); -- 1.8.3.1