Enhance NodeJSLib data flow handling through await.

This commit is contained in:
Napalys
2025-03-26 14:24:52 +01:00
parent 762ca2f8f5
commit 200bf391ce
3 changed files with 19 additions and 3 deletions

View File

@@ -599,7 +599,7 @@ module NodeJSLib {
override DataFlow::Node getADataNode() {
if methodName.matches("%Sync")
then result = this
else
else (
exists(int i, string paramName | fsDataParam(methodName, i, paramName) |
if paramName = "callback"
then
@@ -610,6 +610,12 @@ module NodeJSLib {
)
else result = this.getArgument(i)
)
or
exists(AwaitExpr await |
this.getEnclosingExpr() = await.getOperand() and
result = DataFlow::valueNode(await)
)
)
}
}