Fixed segfault when checking libusbx (daca2)
This commit is contained in:
parent
6da9cca4ab
commit
fa7ae1ae5b
|
@ -1186,6 +1186,8 @@ void CheckBufferOverrun::checkScope(const Token *tok, const ArrayInfo &arrayInfo
|
||||||
// Negative index..
|
// Negative index..
|
||||||
for (const Token *tok2 = tok->next(); tok2 && tok2->str() == "["; tok2 = tok2->link()->next()) {
|
for (const Token *tok2 = tok->next(); tok2 && tok2->str() == "["; tok2 = tok2->link()->next()) {
|
||||||
const Token *index = tok2->astOperand2();
|
const Token *index = tok2->astOperand2();
|
||||||
|
if (!index)
|
||||||
|
continue;
|
||||||
std::list<ValueFlow::Value>::const_iterator it;
|
std::list<ValueFlow::Value>::const_iterator it;
|
||||||
const ValueFlow::Value *val = nullptr;
|
const ValueFlow::Value *val = nullptr;
|
||||||
for (it = index->values.begin(); it != index->values.end(); ++it) {
|
for (it = index->values.begin(); it != index->values.end(); ++it) {
|
||||||
|
|
Loading…
Reference in New Issue