Skip to content

Commit ca719a2

Browse files
Update checkbufferoverrun.cpp
1 parent b5bd734 commit ca719a2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/checkbufferoverrun.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,17 +556,17 @@ ValueFlow::Value CheckBufferOverrunImpl::getBufferSize(const Token *bufTok) cons
556556
{
557557
if (!bufTok->valueType())
558558
return ValueFlow::Value(-1);
559-
const Token* varTok = bufTok;
559+
560560
if (bufTok->isUnaryOp("&")) {
561561
bufTok = bufTok->astOperand1();
562562
if (Token::simpleMatch(bufTok, "[")) {
563563
const Token* index = bufTok->astOperand2();
564564
if (!(index && index->hasKnownIntValue() && index->getKnownIntValue() == 0))
565565
return ValueFlow::Value(-1);
566-
varTok = bufTok->astOperand1();
566+
bufTok = bufTok->astOperand1();
567567
}
568568
}
569-
const Variable *var = varTok->variable();
569+
const Variable *var = bufTok->variable();
570570

571571
if (!var || var->dimensions().empty()) {
572572
const ValueFlow::Value *value = getBufferSizeValue(bufTok);

0 commit comments

Comments
 (0)