@@ -3155,7 +3155,7 @@ class TestBufferOverrun : public TestFixture {
31553155 " (void)strxfrm(dest,src,1);\n "
31563156 " (void)strxfrm(dest,src,2);\n " // <<
31573157 " }" );
3158- ASSERT_EQUALS (" [test.cpp:5]: (error, inconclusive ) Buffer is accessed out of bounds: dest\n " , errout.str ());
3158+ ASSERT_EQUALS (" [test.cpp:5]: (error) Buffer is accessed out of bounds: dest\n " , errout.str ());
31593159 // destination size is too small
31603160 check (" void f(void) {\n "
31613161 " const char src[3] = \" abc\" ;\n "
@@ -3181,7 +3181,7 @@ class TestBufferOverrun : public TestFixture {
31813181 " (void)strxfrm(dest,src,1);\n "
31823182 " (void)strxfrm(dest,src,2);\n " // <<
31833183 " }" );
3184- ASSERT_EQUALS (" [test.cpp:5]: (error, inconclusive ) Buffer is accessed out of bounds: src\n " , errout.str ());
3184+ ASSERT_EQUALS (" [test.cpp:5]: (error) Buffer is accessed out of bounds: src\n " , errout.str ());
31853185 }
31863186
31873187 void buffer_overrun_33 () { // #2019
@@ -3217,6 +3217,14 @@ class TestBufferOverrun : public TestFixture {
32173217 " free(p);\n "
32183218 " }\n " );
32193219 ASSERT_EQUALS (" [test.cpp:4]: (error) Buffer is accessed out of bounds: p\n " , errout.str ());
3220+
3221+ check (" void f() {\n "
3222+ " char* q = \" 0123456789\" ;\n "
3223+ " char* p = (char*)malloc(1);\n "
3224+ " strcpy(p, q);\n "
3225+ " free(p);\n "
3226+ " }\n " );
3227+ ASSERT_EQUALS (" [test.cpp:4]: (error) Buffer is accessed out of bounds: p\n " , errout.str ());
32203228 }
32213229
32223230 void buffer_overrun_errorpath () {
@@ -4231,20 +4239,20 @@ class TestBufferOverrun : public TestFixture {
42314239 " struct Foo x;\n "
42324240 " mysprintf(x.a, \" aa\" );\n "
42334241 " }" , settings);
4234- ASSERT_EQUALS (" [test.cpp:4]: (error, inconclusive ) Buffer is accessed out of bounds: x.a\n " , errout.str ());
4242+ ASSERT_EQUALS (" [test.cpp:4]: (error) Buffer is accessed out of bounds: x.a\n " , errout.str ());
42354243
42364244 // ticket #900
42374245 check (" void f() {\n "
42384246 " char *a = new char(30);\n "
42394247 " mysprintf(a, \" a\" );\n "
42404248 " }" , settings);
4241- TODO_ASSERT_EQUALS (" [test.cpp:3]: (error) Buffer is accessed out of bounds. \n " , " " , errout.str ());
4249+ ASSERT_EQUALS (" [test.cpp:3]: (error) Buffer is accessed out of bounds: a \n " , errout.str ());
42424250
42434251 check (" void f(char value) {\n "
42444252 " char *a = new char(value);\n "
42454253 " mysprintf(a, \" a\" );\n "
42464254 " }" , settings);
4247- TODO_ASSERT_EQUALS (" [test.cpp:3]: (error) Buffer is accessed out of bounds. \n " , " " , errout.str ());
4255+ ASSERT_EQUALS (" [test.cpp:3]: (error) Buffer is accessed out of bounds: a \n " , errout.str ());
42484256
42494257 // This is out of bounds if 'sizeof(ABC)' is 1 (No padding)
42504258 check (" struct Foo { char a[1]; };\n "
@@ -4266,7 +4274,7 @@ class TestBufferOverrun : public TestFixture {
42664274 " struct Foo x;\n "
42674275 " mysprintf(x.a, \" aa\" );\n "
42684276 " }" , settings);
4269- ASSERT_EQUALS (" [test.cpp:4]: (error, inconclusive ) Buffer is accessed out of bounds: x.a\n " , errout.str ());
4277+ ASSERT_EQUALS (" [test.cpp:4]: (error) Buffer is accessed out of bounds: x.a\n " , errout.str ());
42704278
42714279 check (" struct Foo {\n " // #6668 - unknown size
42724280 " char a[LEN];\n "
0 commit comments