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:
Max Schaefer
2018-09-03 09:20:35 +01:00
committed by GitHub
4 changed files with 28 additions and 1 deletions

View File

@@ -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 |

View File

@@ -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
}