Skip to content

Commit 88b6bd9

Browse files
committed
C++: Switch result conflation query to a slightly simpler dataflow-only approach.
1 parent ce2b86b commit 88b6bd9

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

cpp/ql/src/Security/CWE/CWE-295/SSLResultConflation.ql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import cpp
1515
import semmle.code.cpp.controlflow.Guards
16-
import semmle.code.cpp.valuenumbering.GlobalValueNumbering
1716
import semmle.code.cpp.dataflow.DataFlow
1817

1918
class SSLGetVerifyResultCall extends FunctionCall {
@@ -36,14 +35,12 @@ class VerifyResultConfig extends DataFlow::Configuration {
3635
}
3736
}
3837

39-
// TODO: use GVN on *both* sinks to get more results!?
40-
4138
from
4239
VerifyResultConfig config, DataFlow::Node source, DataFlow::Node sink1, DataFlow::Node sink2,
4340
GuardCondition guard, Expr c1, Expr c2, boolean testIsTrue
4441
where
4542
config.hasFlow(source, sink1) and
46-
globalValueNumber(sink1.asExpr()) = globalValueNumber(sink2.asExpr()) and
43+
config.hasFlow(source, sink2) and
4744
guard.comparesEq(sink1.asExpr(), c1, 0, false, testIsTrue) and // (value != c1) => testIsTrue
4845
guard.comparesEq(sink2.asExpr(), c2, 0, false, testIsTrue) and // (value != c2) => testIsTrue
4946
c1.getValue().toInt() = 0 and

0 commit comments

Comments
 (0)