JS: add sanitizer support for ~whitelist.indexOf(x)

This commit is contained in:
Esben Sparre Andreasen
2018-08-20 13:28:19 +02:00
parent 692f416143
commit be8a32bb18
6 changed files with 47 additions and 0 deletions

View File

@@ -176,3 +176,21 @@ function customSanitizer() {
v = SANITIZE(v);
SINK(v);
}
function BitwiseIndexOfCheckSanitizer () {
var v = SOURCE();
SINK(v);
if (~o.indexOf(v)) {
SINK(v);
} else {
SINK(v);
}
if (!~o.indexOf(v)) {
SINK(v);
} else {
SINK(v);
}
}