use if-then-else rather than nested exists

This commit is contained in:
Sim4n6
2023-02-08 21:46:50 +01:00
parent 9e285020a1
commit 4196230a8a

View File

@@ -84,11 +84,9 @@ class UnsafeUnpackingConfig extends TaintTracking::Configuration {
// see wget: https://pypi.org/project/wget/
exists(API::CallNode mcn |
mcn = API::moduleImport("wget").getMember("download").getACall() and
(
source = mcn.getArg(1)
or
source = mcn.getReturn().asSource() and not exists(Node arg | arg = mcn.getArg(1))
)
if exists(Node arg | arg = mcn.getArg(1))
then source = mcn.getArg(1)
else source = mcn.getReturn().asSource()
)
or
// catch the Django uploaded files as a source