mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
23 lines
280 B
JavaScript
23 lines
280 B
JavaScript
function test1(b) {
|
|
let x = 'one';
|
|
if (b) {
|
|
x += source();
|
|
}
|
|
x += 'three';
|
|
sink(x); // NOT OK
|
|
}
|
|
|
|
function test2(x, foo) {
|
|
let taint = source();
|
|
let value = '';
|
|
|
|
sink(value); // OK
|
|
|
|
if (x) {
|
|
value += taint;
|
|
}
|
|
value += foo;
|
|
|
|
sink(value); // NOT OK
|
|
}
|