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
+20-20Lines changed: 20 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -5717,29 +5717,29 @@ class TestBufferOverrun : public TestFixture {
5717
5717
5718
5718
voidgetBufferSizeOfAddressOfVariable() { // #7570
5719
5719
5720
-
check("void f() {\n"
5721
-
" int i;\n"
5722
-
" memset(&i, 0, 1000);\n"
5723
-
"}");
5724
-
ASSERT_EQUALS("[test.cpp:3:10]: (error) Buffer is accessed out of bounds: &i [bufferAccessOutOfBounds]\n", errout_str());
5720
+
check("void f() {\n"
5721
+
" int i;\n"
5722
+
" memset(&i, 0, 1000);\n"
5723
+
"}");
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;\n"
5728
-
" memset(&i, 0, sizeof(i));\n"
5729
-
"}");
5730
-
ASSERT_EQUALS("", errout_str());
5726
+
check("void f() {\n"
5727
+
" int i;\n"
5728
+
" memset(&i, 0, sizeof(i));\n"
5729
+
"}");
5730
+
ASSERT_EQUALS("", errout_str());
5731
5731
5732
-
check("void foo() {\n"
5733
-
" char c[6];\n"
5734
-
" strncpy(&c, \"hello!\", 6);\n"
5735
-
"}");
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());
5732
+
check("void foo() {\n"
5733
+
" char c[6];\n"
5734
+
" strncpy(&c, \"hello!\", 6);\n"
5735
+
"}");
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());
0 commit comments