From c60341c5cd68c71a962021a984d414ff6d803ee5 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 12 May 2022 19:09:33 -0500 Subject: [PATCH] Security: Wrong variable passed resulting in invalid read and writes in Fake. --- level_3/fake/c/private-make-load_fakefile.c | 4 ++-- level_3/fake/c/private-make-operate.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/level_3/fake/c/private-make-load_fakefile.c b/level_3/fake/c/private-make-load_fakefile.c index d901523..4bb5ba3 100644 --- a/level_3/fake/c/private-make-load_fakefile.c +++ b/level_3/fake/c/private-make-load_fakefile.c @@ -53,7 +53,7 @@ extern "C" { f_string_range_t range = macro_f_string_range_t_initialize2(data_make->buffer.used); f_fss_delimits_t delimits = f_fss_delimits_t_initialize; f_fss_comments_t comments = f_fss_comments_t_initialize; - f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data_make->data, 0); + f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data_make->main, 0); *status = fll_fss_basic_list_read(data_make->buffer, state, &range, &list_objects, &list_contents, &delimits, 0, &comments); @@ -85,7 +85,7 @@ extern "C" { f_fss_set_t settings = f_fss_set_t_initialize; - f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data_make->data, 0); + f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data_make->main, 0); if (list_objects.used > data_make->fakefile.size) { macro_f_fss_nameds_t_resize((*status), data_make->fakefile, list_objects.used); diff --git a/level_3/fake/c/private-make-operate.c b/level_3/fake/c/private-make-operate.c index e6f8a56..cd76300 100644 --- a/level_3/fake/c/private-make-operate.c +++ b/level_3/fake/c/private-make-operate.c @@ -122,7 +122,7 @@ extern "C" { } if (status != F_child) { - f_status_t status_path = f_path_change_at(data_make.path.top.id); + const f_status_t status_path = f_path_change_at(data_make.path.top.id); if (F_status_is_error(status_path) && data->main->warning.verbosity >= f_console_verbosity_verbose_e) { flockfile(data->main->warning.to.stream); @@ -167,7 +167,7 @@ extern "C" { f_iki_data_t iki_data = f_iki_data_t_initialize; - f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data_make->data, 0); + f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, 0, &fll_program_standard_signal_state, 0, (void *) data_make->main, 0); f_string_range_t range = f_string_range_t_initialize; f_string_map_multis_t *parameter = &data_make->setting_make.parameter; -- 1.8.3.1