Skip to content

Commit e39229d

Browse files
committed
C++: Remove unique-Instruction kludge in ScanfOutput
Passes tests.
1 parent d8800c0 commit e39229d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

cpp/ql/src/Critical/MissingCheckScanf.ql

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@ class ScanfOutput extends Expr {
2525
ValueNumber valNum;
2626

2727
ScanfOutput() {
28-
this = call.getOutputArgument(varargIndex) and
29-
instr.getUnconvertedResultExpression() = this and
30-
valueNumber(instr) = valNum and
31-
// The following line is a kludge to prohibit more than one associated `instr` field,
32-
// as would occur, for example, when `this` is an access to an array variable.
33-
not instr instanceof ConvertInstruction
28+
this = call.getOutputArgument(varargIndex).getFullyConverted() and
29+
instr.getConvertedResultExpression() = this and
30+
valueNumber(instr) = valNum
3431
}
3532

3633
ScanfFunctionCall getCall() { result = call }

0 commit comments

Comments
 (0)