Merge pull request #7777 from x3ro/fix-ssp-test-on-macos

tests/ssp: Fix on macOS while compiling w/ clang
This commit is contained in:
Joakim Nohlgård 2017-10-31 05:39:57 +01:00 committed by GitHub
commit 4de06b5f96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,9 +28,13 @@ void test_func(void)
{
char buf[16];
/* clang will detect the buffer overflow
* and throw an error if we use `buf` directly */
void *buffer_to_confuse_compiler = buf;
/* cppcheck-suppress bufferAccessOutOfBounds
* (reason: deliberately overflowing stack) */
memset(buf, 0, 32);
memset(buffer_to_confuse_compiler, 0, 32);
}
int main(void)