Merge pull request #2662 from RasmusWL/python-taint-on-eq-test

Python: Only clear taint on constant comparison in if
This commit is contained in:
Taus
2020-01-23 13:41:40 +01:00
committed by GitHub
7 changed files with 53 additions and 1 deletions

View File

@@ -806,7 +806,10 @@ private predicate testEvaluatesMaybe(ControlFlowNode test, ControlFlowNode use)
any(PyEdgeRefinement ref).getTest().getAChild*() = test and
test.getAChild*() = use and
not test.(UnaryExprNode).getNode().getOp() instanceof Not and
not Filters::equality_test(test, use, _, _) and
not exists(ControlFlowNode const |
Filters::equality_test(test, use, _, const) and
const.getNode() instanceof ImmutableLiteral
) and
not Filters::isinstance(test, _, use) and
not test = use
or