Files
codeql/javascript/ql/test/library-tests/TaintTracking/access-path-sanitizer.js
2019-04-12 11:12:50 +01:00

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
}
}