mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Java: Expand ExactPathSanitizer to work on the argument of 'equals' too
This commit is contained in:
@@ -25,6 +25,13 @@ public class Test {
|
||||
else
|
||||
sink(source); // $ hasTaintFlow
|
||||
}
|
||||
{
|
||||
String source = (String) source();
|
||||
if ("/safe/path".equals(source))
|
||||
sink(source); // Safe
|
||||
else
|
||||
sink(source); // $ hasTaintFlow
|
||||
}
|
||||
{
|
||||
URI source = (URI) source();
|
||||
if (source.equals(new URI("http://safe/uri")))
|
||||
|
||||
@@ -25,6 +25,13 @@ class TestKt {
|
||||
else
|
||||
sink(source) // $ hasTaintFlow
|
||||
}
|
||||
run {
|
||||
val source = source() as String?
|
||||
if ("/safe/path".equals(source))
|
||||
sink(source) // Safe
|
||||
else
|
||||
sink(source) // $ hasTaintFlow
|
||||
}
|
||||
run {
|
||||
val source = source() as URI?
|
||||
if (source!!.equals(URI("http://safe/uri")))
|
||||
|
||||
Reference in New Issue
Block a user