File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 5050import java .io .FileOutputStream ;
5151import java .io .IOException ;
5252import java .io .InputStream ;
53- import java .nio .file .Path ;
5453import java .time .Instant ;
5554import java .util .ArrayList ;
5655import 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" ))
You can’t perform that action at this time.
0 commit comments