Array index out of bounds: Fix false positive
This commit is contained in:
parent
7b17b33a49
commit
ea23033a65
|
@ -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;
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue