CheckBufferOverrun: Removed a false positive

This commit is contained in:
Daniel Marjamäki 2008-04-06 11:53:23 +00:00
parent daf1af0570
commit 137a4c6309
2 changed files with 10 additions and 1 deletions

View File

@ -73,7 +73,7 @@ static void CheckBufferOverrun_CheckScope( const TOKEN *tok, const char *varname
}
// Array index..
if ( !IsName(tok->str) && Match(tok->next, "%var1% [ %num% ]", varname) )
if ( !IsName(tok->str) && tok->str[0] != '.' && Match(tok->next, "%var1% [ %num% ]", varname) )
{
const char *num = getstr(tok->next, 2 + varc);
if (strtol(num, NULL, 10) >= size)

View File

@ -307,6 +307,15 @@ static void buffer_overrun()
const char test15[] = "static void f()\n"
"{\n"
" char data[1];\n"
" return abc.data[1];\n"
"}\n";
check( CheckBufferOverrun, __LINE__, test15, "" );
// TODO