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;
|
const Token *stringLiteral = nullptr;
|
||||||
|
|
||||||
if (tok->variable()->dimensions().empty()) {
|
if (!tok->variable()->isArray() && tok->variable()->dimensions().empty()) {
|
||||||
stringLiteral = tok->getValueTokenMinStrSize();
|
stringLiteral = tok->getValueTokenMinStrSize();
|
||||||
if (!stringLiteral)
|
if (!stringLiteral)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -3324,7 +3324,7 @@ private:
|
||||||
" char c[10] = \"c\";\n"
|
" char c[10] = \"c\";\n"
|
||||||
" mymemset(c, 0, 10);\n"
|
" mymemset(c, 0, 10);\n"
|
||||||
"}", settings);
|
"}", settings);
|
||||||
// TODO ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void minsize_sizeof() {
|
void minsize_sizeof() {
|
||||||
|
|
Loading…
Reference in New Issue