We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d9be3c3 commit 4eab2d5Copy full SHA for 4eab2d5
1 file changed
test/testbufferoverrun.cpp
@@ -5515,6 +5515,19 @@ class TestBufferOverrun : public TestFixture {
5515
" f(s);\n"
5516
"}\n");
5517
ASSERT_EQUALS("", errout_str());
5518
+
5519
+ setMultiline();
5520
+ ctu("void g(char* p) {\n"
5521
+ " memset(p + 10, 0, 10);\n"
5522
+ "}\n"
5523
+ "void f() {\n"
5524
+ " char a[10] = {};\n"
5525
+ " g(a);\n"
5526
+ "}");
5527
+ ASSERT_EQUALS("[test.cpp:2:12]: error: Pointer arithmetic overflow; 'p' buffer size is 10 [ctuPointerArith]\n"
5528
+ "[test.cpp:6:6]: note: Calling function g, 1st argument is accessed out of bounds\n"
5529
+ "[test.cpp:2:12]: note: Using argument p\n",
5530
+ errout_str());
5531
}
5532
5533
void objectIndex() {
0 commit comments