]> Kevux Git Server - fll/commitdiff
Security: Incorrect array size used in test.
authorKevin Day <thekevinday@gmail.com>
Fri, 4 Mar 2022 04:56:56 +0000 (22:56 -0600)
committerKevin Day <thekevinday@gmail.com>
Fri, 4 Mar 2022 04:56:56 +0000 (22:56 -0600)
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

index 93dfa1087e2d33d2de06a00dfba686cfd61b8859..dea42947f8ebf632261354d334428c2ca0baff03 100644 (file)
@@ -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";