mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C++: Ensure that the instruction being compared is the result of the 'CallInstruction'.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user