Skip to content

Commit 8654ebc

Browse files
committed
C++: Avoid using nullValue predicate
The `nullValue` predicate performs a slow custom data-flow analysis to find possible null values. It's so slow that it timed out after 1200s on Wireshark. In `UnsafeCreateProcessCall.ql`, the values found with `nullValue` were used as sources in another data-flow analysis. By using the `NullValue` class as sink instead of `nullValue`, we avoid the slow-down of doing data flow twice. The `NullValue` class is essentially the base case of `nullValue`. Confusing names, yes.
1 parent f4ec168 commit 8654ebc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/ql/src/Security/CWE/CWE-428/UnsafeCreateProcessCall.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class NullAppNameCreateProcessFunctionConfiguration extends DataFlow::Configurat
6868
}
6969

7070
override predicate isSource(DataFlow::Node source) {
71-
nullValue(source.asExpr())
71+
source.asExpr() instanceof NullValue
7272
}
7373

7474
override predicate isSink(DataFlow::Node sink) {

0 commit comments

Comments
 (0)