Pointer overflow: Fixed false positive

This commit is contained in:
Daniel Marjamäki 2018-01-27 22:09:43 +01:00
parent 189e0b3890
commit 5b6ec49a6f
1 changed files with 1 additions and 1 deletions

View File

@ -1507,7 +1507,7 @@ void CheckBufferOverrun::bufferOverrun()
continue;
const Variable *var = pointerToken->variable();
if (!var || !var->isArray())
if (!var || !var->isArray() || var->dimension(0) <= 0)
continue;
const ValueFlow::Value *value = indexToken->getValueGE(var->dimension(0)+1, _settings);