mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Merge pull request #117 from esben-semmle/js/push-sort-taint-steps
JS: support `push` and `sort` taint steps for arrays
This commit is contained in:
@@ -1,2 +1,5 @@
|
||||
| tst.js:2:13:2:20 | source() | tst.js:4:10:4:10 | x |
|
||||
| tst.js:2:13:2:20 | source() | tst.js:5:10:5:22 | "/" + x + "!" |
|
||||
| tst.js:2:13:2:20 | source() | tst.js:14:10:14:17 | x.sort() |
|
||||
| tst.js:2:13:2:20 | source() | tst.js:17:10:17:10 | a |
|
||||
| tst.js:2:13:2:20 | source() | tst.js:19:10:19:10 | a |
|
||||
|
||||
@@ -10,4 +10,12 @@ function test() {
|
||||
sink(x === 1); // OK
|
||||
sink(undefined == x); // OK
|
||||
sink(x === x); // OK
|
||||
|
||||
sink(x.sort()); // NOT OK
|
||||
|
||||
var a = [];
|
||||
sink(a); // NOT OK (flow-insensitive treatment of `a`)
|
||||
a.push(x);
|
||||
sink(a); // NOT OK
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user