Skip to content

Commit 833d842

Browse files
committed
Drop the getPath check from the library
1 parent 657f615 commit 833d842

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

java/ql/src/experimental/semmle/code/java/PathSanitizer.qll

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ private class ExactStringPathMatchGuard extends PathTraversalBarrierGuard instan
2121
}
2222

2323
/**
24-
* Returns the qualifier of a method call if it's a variable access, or the qualifier of the qualifier if
25-
* the qualifier itself is a method call to `getPath`, which helps to reduce FPs by handling scenarios
26-
* such as `!uri.getPath().contains("..")`.
24+
* Returns the qualifier of a method call if it's a variable access, or the qualifier of the qualifier
25+
* if the qualifier itself is a method call, which helps to reduce FPs by handling scenarios such as
26+
* `!uri.getPath().contains("..")`.
2727
*/
2828
private Expr getRealQualifier(Expr e) {
29-
e.(MethodAccess).getMethod().hasQualifiedName("android.net", "Uri", "getPath") and
30-
result = e.(MethodAccess).getQualifier()
29+
result = getRealQualifier(e.(MethodAccess).getQualifier())
3130
or
3231
result = e.(VarAccess)
3332
}

0 commit comments

Comments
 (0)