mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
JS: add sanitizer support for ~whitelist.indexOf(x)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user