Skip to content
Snippets Groups Projects
Unverified Commit 4de06b5f authored by Joakim Nohlgård's avatar Joakim Nohlgård Committed by GitHub
Browse files

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

tests/ssp: Fix on macOS while compiling w/ clang
parents b80cdd81 47107014
No related branches found
No related tags found
No related merge requests found
...@@ -28,9 +28,13 @@ void test_func(void) ...@@ -28,9 +28,13 @@ void test_func(void)
{ {
char buf[16]; 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 /* cppcheck-suppress bufferAccessOutOfBounds
* (reason: deliberately overflowing stack) */ * (reason: deliberately overflowing stack) */
memset(buf, 0, 32); memset(buffer_to_confuse_compiler, 0, 32);
} }
int main(void) int main(void)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment