Skip to content

Commit 2fbdece

Browse files
committed
add getContainedNode constraint to charpred of IndirectInclusionTest, and refactor two getEnclosingExpr()
1 parent f8de691 commit 2fbdece

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

javascript/ql/src/semmle/javascript/InclusionTests.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,20 @@ module InclusionTest {
7171
count(this.getACallee()) = 1 and
7272
count(callee.getAReturnedExpr()) = 1 and
7373
not this.isImprecise() and
74+
inner.getContainedNode().getALocalSource() = DataFlow::parameterNode(callee.getAParameter()) and
7475
inner.getContainerNode().getALocalSource() = DataFlow::parameterNode(callee.getAParameter())
7576
}
7677

7778
override DataFlow::Node getContainerNode() {
7879
exists(int arg |
79-
inner.getContainerNode().getALocalSource().getEnclosingExpr() = callee.getParameter(arg) and
80+
inner.getContainerNode().getALocalSource() = DataFlow::parameterNode(callee.getParameter(arg)) and
8081
result = this.getArgument(arg)
8182
)
8283
}
8384

8485
override DataFlow::Node getContainedNode() {
8586
exists(int arg |
86-
inner.getContainedNode().getALocalSource().getEnclosingExpr() = callee.getParameter(arg) and
87+
inner.getContainedNode().getALocalSource() = DataFlow::parameterNode(callee.getParameter(arg)) and
8788
result = this.getArgument(arg)
8889
)
8990
}

0 commit comments

Comments
 (0)