Skip to content

Commit b15a644

Browse files
committed
C++: ExecTainted
1 parent 87889d6 commit b15a644

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

cpp/ql/src/Security/CWE/CWE-078/ExecTainted.ql

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,15 @@ module ExecTaintConfig implements DataFlow::StateConfigSig {
151151
isSink(node, _) // Prevent duplicates along a call chain, since `shellCommand` will include wrappers
152152
}
153153

154-
predicate observeDiffInformedIncrementalMode() {
155-
any() // TODO: Make sure that the location overrides match the query's select clause: Column 1 does not select a source or sink originating from the flow call on line 161 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Security/CWE/CWE-078/ExecTainted.ql@165:8:165:14), Column 7 does not select a source or sink originating from the flow call on line 161 (/Users/d10c/src/semmle-code/ql/cpp/ql/src/Security/CWE/CWE-078/ExecTainted.ql@167:71:167:82)
154+
predicate observeDiffInformedIncrementalMode() { any() }
155+
156+
Location getASelectedSinkLocation(DataFlow::Node sink) {
157+
exists(DataFlow::Node concatResult, Expr command, ExecState state |
158+
result = [concatResult.getLocation(), command.getLocation()] and
159+
isSink(sink, state) and
160+
isSinkImpl(sink, command, _) and
161+
concatResult = state.getOutgoingNode()
162+
)
156163
}
157164
}
158165

0 commit comments

Comments
 (0)