Skip to content

Commit

Permalink
Merge pull request #18503 from MathiasVP/scanf-check-prepare-fix
Browse files Browse the repository at this point in the history
C++: Harden `checkedForEof`
  • Loading branch information
MathiasVP authored Jan 16, 2025
2 parents 90faab4 + 01cbd2f commit a0d2213
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/ql/src/Critical/ScanfChecks.qll
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private string getEofValue() {
*/
private predicate checkedForEof(ScanfFunctionCall call) {
exists(IRGuardCondition gc |
exists(Instruction i | i.getUnconvertedResultExpression() = call |
exists(CallInstruction i | i.getUnconvertedResultExpression() = call |
exists(int val | gc.comparesEq(valueNumber(i).getAUse(), val, _, _) |
// call == EOF
val = getEofValue().toInt()
Expand Down

0 comments on commit a0d2213

Please sign in to comment.