From 8eeff5cf48ee128f4038747affcf70cd8dc9fe00 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 3 Mar 2022 22:56:56 -0600 Subject: [PATCH] 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. --- level_0/f_control_group/tests/unit/c/test-control_group-copy.c | 1 + 1 file changed, 1 insertion(+) 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"; -- 1.8.3.1