From: Kevin Day Date: Tue, 8 Aug 2023 01:02:45 +0000 (-0500) Subject: Regression: Incorrect type on memset() in array resulting in invalid read. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=6ae1888d74a1c9ce86ff9abb6662ea4b1b23fb25;p=fll 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. --- 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);