diff --git a/CheckBufferOverrun.cpp b/CheckBufferOverrun.cpp index ca07a4b09..fcd16c9ef 100644 --- a/CheckBufferOverrun.cpp +++ b/CheckBufferOverrun.cpp @@ -1,4 +1,4 @@ -/* +/* * c++check - c/c++ syntax checking * Copyright (C) 2007 Daniel Marjamäki * @@ -91,7 +91,7 @@ static void CheckBufferOverrun_CheckScope( const TOKEN *tok, const char *varname } // Array index.. - if ( !IsName(tok->str) && tok->str[0] != '.' && Match(tok->next, "%var1% [ %num% ]", varname) ) + if ( !Match(tok, "%var%") && !Match(tok,"[.&]") && Match(tok->next, "%var1% [ %num% ]", varname) ) { const char *num = getstr(tok->next, 2 + varc); if (strtol(num, NULL, 10) >= size) diff --git a/testbufferoverrun.cpp b/testbufferoverrun.cpp index c346a196e..a8b3e471e 100644 --- a/testbufferoverrun.cpp +++ b/testbufferoverrun.cpp @@ -61,9 +61,7 @@ private: TEST_CASE( noerr1 ); TEST_CASE( noerr2 ); TEST_CASE( noerr3 ); - - // Todo: Fix this. - //TEST_CASE( noerr4 ); + TEST_CASE( noerr4 ); TEST_CASE( array_index_1 ); TEST_CASE( array_index_2 );