Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ private static Properties installJars(final File m2Root, final boolean forceOver
if (entry.getName().startsWith("MAVEN-INF/repository/")) {
final String path = entry.getName().substring("MAVEN-INF/repository/".length());
final File output = new File(m2Root, path);
if (!output.getCanonicalPath().startsWith(m2Root.getCanonicalPath())) {
if (!output.getCanonicalPath().startsWith(m2Root.getCanonicalPath() + File.separator)) {
throw new IOException("The output file is not contained in the destination directory");
}
if (!output.exists() || forceOverwrite) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private static void unzip(final InputStream read, final File destination, final
path = path.replaceFirst("^[^/]+/", "");
}
final File file = new File(destination, path);
if (!file.getCanonicalPath().startsWith(destination.getCanonicalPath())) {
if (!file.getCanonicalPath().startsWith(destination.getCanonicalPath() + File.separator)) {
throw new IOException("The output file is not contained in the destination directory");
}

Expand Down