Skip to content

Commit 38af593

Browse files
Update testbufferoverrun.cpp
1 parent 3f2d60c commit 38af593

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
@@ -3545,6 +3545,12 @@ class TestBufferOverrun : public TestFixture {
35453545
" std::memset(&buf[0], 0, 25);\n"
35463546
"}\n");
35473547
ASSERT_EQUALS("", errout_str());
3548+
3549+
check("void f() {\n" // #14859
3550+
" std::vector<char> buf(25);\n"
3551+
" std::memset(&buf[0], 0, 26);\n"
3552+
"}\n");
3553+
ASSERT_EQUALS("[test.cpp:3:17]: (error) Buffer is accessed out of bounds: &buf[0] [bufferAccessOutOfBounds]\n", errout_str());
35483554
}
35493555

35503556
void buffer_overrun_errorpath() {

0 commit comments

Comments
 (0)