Skip to content
Open
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 @@ -233,7 +233,11 @@ private void extract(Path jarPath, Path destDir) throws IOException {
Enumeration<JarEntry> enumEntries = jar.entries();
while (enumEntries.hasMoreElements()) {
JarEntry entry = enumEntries.nextElement();
File f = destDir.resolve(entry.getName()).toFile();
final Path zipEntryPath = destDir.resolve(entry.getName());
if (!zipEntryPath.normalize().startsWith(destDir.normalize())) {
throw new IOException("Bad zip entry");
}
File f = zipEntryPath.toFile();
f.getParentFile().mkdirs();
InputStream is = jar.getInputStream(entry);
FileOutputStream fos = new FileOutputStream(f);
Expand Down