You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/testbufferoverrun.cpp
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5723,6 +5723,12 @@ class TestBufferOverrun : public TestFixture {
5723
5723
"}");
5724
5724
ASSERT_EQUALS("[test.cpp:3:10]: (error) Buffer is accessed out of bounds: &i [bufferAccessOutOfBounds]\n", errout_str());
5725
5725
5726
+
check("void f() {\n"
5727
+
" int i[2];\n"
5728
+
" memset(&i, 0, 1000);\n"
5729
+
"}");
5730
+
ASSERT_EQUALS("[test.cpp:3:10]: (error) Buffer is accessed out of bounds: i [bufferAccessOutOfBounds]\n", errout_str());
5731
+
5726
5732
check("void f() {\n"
5727
5733
" int i;\n"
5728
5734
" memset(&i, 0, sizeof(i));\n"
@@ -5733,7 +5739,7 @@ class TestBufferOverrun : public TestFixture {
5733
5739
" char c[6];\n"
5734
5740
" strncpy(&c, \"hello!\", 6);\n"
5735
5741
"}");
5736
-
ASSERT_EQUALS("[test.cpp:3:3]: (warning, inconclusive) The buffer '&c' may not be null-terminated after the call to strncpy(). [terminateStrncpy]\n", errout_str());
5742
+
ASSERT_EQUALS("[test.cpp:3:3]: (warning, inconclusive) The buffer 'c' may not be null-terminated after the call to strncpy(). [terminateStrncpy]\n", errout_str());
0 commit comments