File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
java/ql/test/library-tests/pathsanitizer Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,18 @@ class TestKt {
106106 }
107107 run {
108108 val source: File ? = source() as File ?
109- val normalized: File = source!! .canonicalFile.toString()
109+ val normalized: File = source!! .canonicalFile
110+ if (normalized.startsWith(" /safe" )) {
111+ sink(source) // Safe
112+ sink(normalized) // Safe
113+ } else {
114+ sink(source) // $ hasTaintFlow
115+ sink(normalized) // $ hasTaintFlow
116+ }
117+ }
118+ run {
119+ val source: File ? = source() as File ?
120+ val normalized: String = source!! .canonicalFile.toString()
110121 if (normalized.startsWith(" /safe" )) {
111122 sink(source) // Safe
112123 sink(normalized) // Safe
@@ -337,6 +348,17 @@ class TestKt {
337348 sink(normalized) // $ hasTaintFlow
338349 }
339350 }
351+ run {
352+ val source: File ? = source() as File ?
353+ val normalized: File = source!! .canonicalFile
354+ if (! normalized.startsWith(" /data" )) {
355+ sink(source) // Safe
356+ sink(normalized) // Safe
357+ } else {
358+ sink(source) // $ hasTaintFlow
359+ sink(normalized) // $ hasTaintFlow
360+ }
361+ }
340362 run {
341363 val source: File ? = source() as File ?
342364 val normalized: String = source!! .canonicalFile.toString()
You can’t perform that action at this time.
0 commit comments