Fixed #1274 (false positive: Dangerous usage of strncat)
This commit is contained in:
parent
4f30468c80
commit
a0e96be0c3
|
@ -538,7 +538,7 @@ void CheckBufferOverrun::checkScope(const Token *tok, const char *varname[], con
|
||||||
if (varid > 0 && Token::Match(tok, "strncat ( %varid% , %any% , %num% )", varid))
|
if (varid > 0 && Token::Match(tok, "strncat ( %varid% , %any% , %num% )", varid))
|
||||||
{
|
{
|
||||||
int n = std::atoi(tok->strAt(6));
|
int n = std::atoi(tok->strAt(6));
|
||||||
if (n >= (total_size - 1))
|
if (n >= total_size)
|
||||||
strncatUsage(tok);
|
strncatUsage(tok);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue