recognize the define(..) call in PackageExports.qll

This commit is contained in:
Erik Krogh Kristensen
2021-05-05 11:23:25 +02:00
parent 3ca670146e
commit 28eef264e5

View File

@@ -67,7 +67,8 @@ private DataFlow::Node getAValueExportedByPackage() {
exists(ImmediatelyInvokedFunctionExpr func, DataFlow::ParameterNode prev, int i |
prev.getName() = "factory" and
func.getParameter(i) = prev.getParameter() and
result = func.getInvocation().getArgument(i).flow().getAFunctionValue().getAReturn()
result = func.getInvocation().getArgument(i).flow().getAFunctionValue().getAReturn() and
DataFlow::globalVarRef("define").getACall().getArgument(1) = prev.getALocalUse()
)
or
// the exported value is a call to a unique callee