mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
16 lines
226 B
JavaScript
16 lines
226 B
JavaScript
let whitelist = ['a', 'b', 'c'];
|
|
|
|
function test() {
|
|
let x = source();
|
|
|
|
if (whitelist.indexOf(x) < -1) {
|
|
// unreachable
|
|
} else {
|
|
sink(x); // NOT OK
|
|
}
|
|
|
|
if (whitelist.indexOf(x) > 1) {
|
|
sink(x) // OK
|
|
}
|
|
}
|