From: Kevin Day Date: Fri, 4 Mar 2022 04:56:56 +0000 (-0600) Subject: Security: Incorrect array size used in test. X-Git-Tag: 0.5.9~94 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=8eeff5cf48ee128f4038747affcf70cd8dc9fe00;p=fll Security: Incorrect array size used in test. The groups is testing an array of size 3 but it is only defines as size 2. This test itself effectively has an invalid read (a stack overflow). CLang properly identifies this problem but GCC does not. --- diff --git a/level_0/f_control_group/tests/unit/c/test-control_group-copy.c b/level_0/f_control_group/tests/unit/c/test-control_group-copy.c index 93dfa10..dea4294 100644 --- a/level_0/f_control_group/tests/unit/c/test-control_group-copy.c +++ b/level_0/f_control_group/tests/unit/c/test-control_group-copy.c @@ -122,6 +122,7 @@ void test__f_control_group_copy__works(void **state) { f_string_static_t groups[] = { f_string_static_t_initialize, f_string_static_t_initialize, + f_string_static_t_initialize, }; groups[0].string = "group_1";