mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
18 lines
283 B
JavaScript
18 lines
283 B
JavaScript
function foo() {
|
|
let obj = { x: source() };
|
|
|
|
sink(obj.x); // NOT OK
|
|
|
|
if (isSafe(obj.x)) {
|
|
sink(obj.x); // OK
|
|
}
|
|
|
|
if (typeof obj === "object" && isSafe(obj.x)) {
|
|
sink(obj.x); // OK
|
|
}
|
|
|
|
if (isSafe(obj.x) && typeof obj === "object") {
|
|
sink(obj.x); // OK
|
|
}
|
|
}
|