We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2de9b63 commit a6ad7d6Copy full SHA for a6ad7d6
src/main/java/edu/kit/datamanager/ro_crate/reader/ReadZipStreamStrategy.java
@@ -120,7 +120,8 @@ private void readCrate(InputStream stream) throws IOException {
120
while ((localFileHeader = zipInputStream.getNextEntry()) != null) {
121
String fileName = localFileHeader.getFileName();
122
File extractedFile = new File(folder, fileName).getCanonicalFile();
123
- if (!extractedFile.toPath().startsWith(folder.getCanonicalPath())) {
+ Path targetRoot = folder.toPath().toRealPath();
124
+ if (!extractedFile.toPath().startsWith(targetRoot)) {
125
throw new IOException("Entry is outside of target directory: " + fileName);
126
}
127
if (localFileHeader.isDirectory()) {
0 commit comments