Python: Don't rely on all DataFlowCall being resolved

I've been living dangerously with that assumption :|
This commit is contained in:
Rasmus Wriedt Larsen
2022-11-01 16:04:25 +01:00
parent 478f5ffe96
commit df4d09b3f9
2 changed files with 3 additions and 1 deletions

View File

@@ -87,6 +87,7 @@ newtype TInterestingExternalApiCall =
} or
TResolvedCall(DataFlowPrivate::DataFlowCall call) {
exists(call.getLocation().getFile().getRelativePath()) and
exists(call.getCallable()) and
not call.getCallable() = any(SafeExternalApi safe).getSafeCallable() and
// ignore calls inside codebase, and ignore calls that are marked as safe. This is
// only needed as long as we extract dependencies. When we stop doing that, all

View File

@@ -17,7 +17,8 @@ class DataFlowCallTest extends InlineExpectationsTest {
exists(location.getFile().getRelativePath()) and
exists(DataFlowDispatch::DataFlowCall call |
location = call.getLocation() and
element = call.toString()
element = call.toString() and
exists(call.getCallable())
|
value = prettyExpr(call.getNode().getNode()) and
tag = "call"