File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4625,7 +4625,22 @@ class TestBufferOverrun : public TestFixture {
46254625 " const std::string b = \" b\" ;\n "
46264626 " char a[1];\n "
46274627 " sprintf(a, \" %s\" , b.c_str());\n "
4628- " }" , settings0);
4628+ " }\n "
4629+ " void i() {\n "
4630+ " const char b[] = \" b\" ;\n "
4631+ " char a[2];\n "
4632+ " sprintf(a, \" %s\" , b);\n "
4633+ " }\n "
4634+ " void j() {\n "
4635+ " const char* b = \" b\" ;\n "
4636+ " char a[2];\n "
4637+ " sprintf(a, \" %s\" , b);\n "
4638+ " }\n "
4639+ " void k() {\n "
4640+ " const std::string b = \" b\" ;\n "
4641+ " char a[2];\n "
4642+ " sprintf(a, \" %s\" , b.c_str());\n "
4643+ " }\n " , settings0);
46294644 ASSERT_EQUALS (" [test.cpp:4:13]: (error) Buffer is accessed out of bounds: a [bufferAccessOutOfBounds]\n "
46304645 " [test.cpp:9:13]: (error) Buffer is accessed out of bounds: a [bufferAccessOutOfBounds]\n "
46314646 " [test.cpp:14:13]: (error) Buffer is accessed out of bounds: a [bufferAccessOutOfBounds]\n " ,
You can’t perform that action at this time.
0 commit comments