Array index out of bounds: Fix false positive

This commit is contained in:
Daniel Marjamäki 2019-03-11 20:33:08 +01:00
parent 7b17b33a49
commit ea23033a65
2 changed files with 2 additions and 2 deletions

View File

@ -192,7 +192,7 @@ void CheckBufferOverrun::arrayIndex()
const Token *stringLiteral = nullptr;
if (tok->variable()->dimensions().empty()) {
if (!tok->variable()->isArray() && tok->variable()->dimensions().empty()) {
stringLiteral = tok->getValueTokenMinStrSize();
if (!stringLiteral)
continue;

View File

@ -3324,7 +3324,7 @@ private:
" char c[10] = \"c\";\n"
" mymemset(c, 0, 10);\n"
"}", settings);
// TODO ASSERT_EQUALS("", errout.str());
ASSERT_EQUALS("", errout.str());
}
void minsize_sizeof() {