Skip to content

Commit 06993ef

Browse files
Fix code scanning alert no. 103: Partial path traversal vulnerability from remote (#216)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent eae9b14 commit 06993ef

File tree

1 file changed

+1
-1
lines changed
  • fj-doc-playground-quarkus/src/main/java/org/fugerit/java/doc/playground/init

1 file changed

+1
-1
lines changed

fj-doc-playground-quarkus/src/main/java/org/fugerit/java/doc/playground/init/ProjectRest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public static String ensureEndWithSlash( String name ) {
107107
}
108108
public static void checkIfInTempFolder( File file ) throws IOException {
109109
File tempDir = new File( System.getProperty("java.io.tmpdir") );
110-
if ( !file.getCanonicalPath().startsWith( tempDir.getCanonicalPath() ) ) {
110+
if ( !file.toPath().normalize().startsWith(tempDir.toPath().normalize()) ) {
111111
throw new IOException( file.getCanonicalPath() + " is not in temp folder" );
112112
}
113113
}

0 commit comments

Comments
 (0)