mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
Improve naming; eliminate some harmless extra results
Adding `src != valueSource` should have no effect as the introduced edge would already exist, but could reduce workload downstream.
This commit is contained in:
@@ -71,18 +71,19 @@ private predicate localAdditionalBasicTaintStep(DataFlow::Node src, DataFlow::No
|
||||
* `a` is tainted after `f` completes, and vice versa.
|
||||
*/
|
||||
private predicate composedValueAndTaintModelStep(ArgumentNode src, DataFlow::Node sink) {
|
||||
exists(Call call, ArgumentNode valueSource, DataFlow::PostUpdateNode valueSourcePun |
|
||||
exists(Call call, ArgumentNode valueSource, DataFlow::PostUpdateNode valueSourcePost |
|
||||
src.argumentOf(call, _) and
|
||||
valueSource.argumentOf(call, _) and
|
||||
valueSourcePun.getPreUpdateNode() = valueSource and
|
||||
src != valueSource and
|
||||
valueSourcePost.getPreUpdateNode() = valueSource and
|
||||
DataFlow::localFlowStep(valueSource, DataFlow::exprNode(call)) and
|
||||
(
|
||||
// in-x -value-> out-y and in-z -taint-> out-y ==> in-z -taint-> in-x
|
||||
localAdditionalBasicTaintStep(src, DataFlow::exprNode(call)) and
|
||||
sink = valueSourcePun
|
||||
sink = valueSourcePost
|
||||
or
|
||||
// in-x -value-> out-y and in-z -taint-> in-x ==> in-z -taint-> out-y
|
||||
localAdditionalBasicTaintStep(src, valueSourcePun) and
|
||||
localAdditionalBasicTaintStep(src, valueSourcePost) and
|
||||
sink = DataFlow::exprNode(call)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user