Skip to content

Commit b8b68b2

Browse files
committed
Fix build error
1 parent be9dee8 commit b8b68b2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/DashboardResources.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
import java.io.FileOutputStream;
5151
import java.io.IOException;
5252
import java.io.InputStream;
53-
import java.nio.file.Path;
5453
import java.time.Instant;
5554
import java.util.ArrayList;
5655
import java.util.Arrays;
@@ -941,10 +940,10 @@ public Response getImage(
941940
.build();
942941
}
943942

944-
// Use Path normalization to prevent path traversal (CodeQL-recognized sanitizer)
943+
// Use java.nio.file.Path normalization to prevent path traversal
945944
File uploadDir = getUploadDir();
946-
Path basePath = uploadDir.toPath();
947-
Path resolvedPath = basePath.resolve(filename).normalize();
945+
java.nio.file.Path basePath = uploadDir.toPath();
946+
java.nio.file.Path resolvedPath = basePath.resolve(filename).normalize();
948947
if (!resolvedPath.startsWith(basePath)) {
949948
return Response.status(Response.Status.BAD_REQUEST)
950949
.entity(new MessageResponse("Invalid filename"))

0 commit comments

Comments
 (0)