Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa841c3

Browse files
committed
C++: Use virtual dispatch in DefaultTaintTracking
This bit is only used by the compatibility code that sends flow into parameters of functions without body.
1 parent ec9ef33 commit aa841c3

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cpp/ql/src/semmle/code/cpp/ir/dataflow/DefaultTaintTracking.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import cpp
22
import semmle.code.cpp.security.Security
33
private import semmle.code.cpp.ir.dataflow.DataFlow
44
private import semmle.code.cpp.ir.IR
5+
private import semmle.code.cpp.ir.dataflow.internal.DataFlowDispatch as Dispatch
56

67
/**
78
* A predictable instruction is one where an external user can predict
@@ -145,7 +146,8 @@ GlobalOrNamespaceVariable globalVarFromId(string id) {
145146
}
146147

147148
Function resolveCall(Call call) {
148-
// TODO: improve virtual dispatch. This will help in the test for
149-
// `UncontrolledProcessOperation.ql`.
150-
result = call.getTarget()
149+
exists(CallInstruction callInstruction |
150+
callInstruction.getAST() = call and
151+
result = Dispatch::viableCallable(callInstruction)
152+
)
151153
}

0 commit comments

Comments
 (0)