Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6331529

Browse files
committed
JS: ArrayConcatStep
1 parent 17d1e6d commit 6331529

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

javascript/ql/src/semmle/javascript/Arrays.qll

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,14 @@ private module ArrayDataFlow {
265265
* A step for modelling `concat`.
266266
* For example in `e = arr1.concat(arr2, arr3)`: if any of the `arr` is tainted, then so is `e`.
267267
*/
268-
private class ArrayConcatStep extends DataFlow::AdditionalFlowStep, DataFlow::MethodCallNode {
269-
ArrayConcatStep() { this.getMethodName() = "concat" }
270-
268+
private class ArrayConcatStep extends DataFlow::SharedFlowStep {
271269
override predicate loadStoreStep(DataFlow::Node pred, DataFlow::Node succ, string prop) {
272-
prop = arrayElement() and
273-
(pred = this.getReceiver() or pred = this.getAnArgument()) and
274-
succ = this
270+
exists(DataFlow::MethodCallNode call |
271+
call.getMethodName() = "concat" and
272+
prop = arrayElement() and
273+
(pred = call.getReceiver() or pred = call.getAnArgument()) and
274+
succ = call
275+
)
275276
}
276277
}
277278

0 commit comments

Comments
 (0)