testbufferoverrun : Added a testcase where variable id is needed to avoid false positive
This commit is contained in:
parent
edff8d326f
commit
90bc72a413
|
@ -79,6 +79,8 @@ private:
|
|||
|
||||
TEST_CASE( buffer_overrun_1 );
|
||||
TEST_CASE( buffer_overrun_2 );
|
||||
|
||||
// TODO TEST_CASE( varid1 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -353,6 +355,22 @@ private:
|
|||
}
|
||||
|
||||
|
||||
|
||||
void varid1()
|
||||
{
|
||||
check( "void foo()\n"
|
||||
"{\n"
|
||||
" char str[10];\n"
|
||||
" if (str[0])\n"
|
||||
" {\n"
|
||||
" char str[50];\n"
|
||||
" str[30] = 0;\n"
|
||||
" }\n"
|
||||
"}\n" );
|
||||
ASSERT_EQUALS( std::string(""), errout.str() );
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
REGISTER_TEST( TestBufferOverrun )
|
||||
|
|
Loading…
Reference in New Issue