Skip to content
Merged
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 @@ -404,8 +404,13 @@ private Path downloadEmulator() throws IOException {
log.fine("Unzipping emulator");
}
ZipEntry entry = zipIn.getNextEntry();
while (entry != null) {
File filePath = new File(emulatorPath.toFile(), entry.getName());
while (entry != null) {
File filePath = new File(emulatorFolder, entry.getName());
String canonicalEmulatorFolderPath = emulatorFolder.getCanonicalPath();
String canonicalFilePath = filePath.getCanonicalPath();
if (!canonicalFilePath.startsWith(canonicalEmulatorFolderPath + File.separator)) {
throw new IllegalStateException("Entry is outside of the target dir: " + entry.getName());
}
if (!entry.isDirectory()) {
extractFile(zipIn, filePath);
} else {
Expand Down