diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index cb863ac2a..3bd02041a 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -1904,7 +1904,7 @@ Check::FileInfo* CheckBufferOverrun::getFileInfo(const Tokenizer *tokenizer, con const std::list &varlist = symbolDatabase->scopeList.front().varlist; for (std::list::const_iterator it = varlist.begin(); it != varlist.end(); ++it) { const Variable &var = *it; - if (!var.isStatic() && var.isArray() && var.dimensions().size() == 1U) + if (!var.isStatic() && var.isArray() && var.dimensions().size() == 1U && var.dimension(0U) > 0U) fileInfo->arraySize[var.name()] = var.dimension(0U); }