Skip to content

Commit 2a9cf3e

Browse files
committed
Use getKnownValue()
1 parent 40fbd6e commit 2a9cf3e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/checkbufferoverrun.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,9 @@ static bool checkBufferSize(const Token *ftok, const Library::ArgumentChecks::Mi
646646
break;
647647
case Library::ArgumentChecks::MinSize::Type::ARGVALUE: {
648648
if (arg) {
649-
const ValueFlow::Value* argVal = arg->hasKnownIntValue() ? &arg->values().front() : arg->getMaxValue(true);
649+
const ValueFlow::Value* argVal = arg->hasKnownIntValue() ?
650+
arg->getKnownValue(ValueFlow::Value::ValueType::INT) :
651+
arg->getMaxValue(/*condition*/ true);
650652
if (!argVal)
651653
break;
652654
MathLib::bigint myMinsize = argVal->intvalue;

0 commit comments

Comments
 (0)