Skip to content

Commit 08b481b

Browse files
committed
[NFC] Add TODO testcase for &buf[i]
1 parent ed53e76 commit 08b481b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/testbufferoverrun.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5735,6 +5735,12 @@ class TestBufferOverrun : public TestFixture {
57355735
"}");
57365736
ASSERT_EQUALS("", errout_str());
57375737

5738+
check("void f() {\n"
5739+
" int i[10];\n"
5740+
" memset(&i[1], 0, 1000);\n"
5741+
"}");
5742+
TODO_ASSERT_EQUALS("[test.cpp:3:10]: (error) Buffer is accessed out of bounds: &i[1] [bufferAccessOutOfBounds]\n", "", errout_str());
5743+
57385744
check("void foo() {\n"
57395745
" char c[6];\n"
57405746
" strncpy(&c, \"hello!\", 6);\n"

0 commit comments

Comments
 (0)