Skip to content

Commit

Permalink
Merge pull request #18561 from jketema/jketema/scanf
Browse files Browse the repository at this point in the history
C++: Fix join-order problem found on `IncorrectCheckScanf.ql`
  • Loading branch information
jketema authored Jan 23, 2025
2 parents dcdc12f + 68ec4b6 commit 8b2cfa9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/ql/lib/semmle/code/cpp/controlflow/IRGuards.qll
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,8 @@ private module Cached {
or
exists(CompareValueNumber cmp, Operand left, Operand right, AbstractValue v |
test = cmp and
cmp.hasOperands(left, right) and
pragma[only_bind_into](cmp)
.hasOperands(pragma[only_bind_into](left), pragma[only_bind_into](right)) and
isConvertedBool(left.getDef()) and
int_value(right.getDef()) = 0 and
unary_compares_eq(valueNumberOfOperand(left), op, k, areEqual, v)
Expand Down

0 comments on commit 8b2cfa9

Please sign in to comment.