Skip to content
This repository was archived by the owner on Aug 19, 2022. It is now read-only.
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
3 changes: 3 additions & 0 deletions src/main/java/ch/digitalfondue/stampo/command/New.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ public void run() {

private void extractFile(Path outputPath, ZipEntry ze, InputStream zip) {
Path destinationPath = outputPath.resolve(ze.getName());
if (!destinationPath.normalize().startsWith(outputPath.normalize())) {
throw new RuntimeException("Bad zip entry");
}
try {
Files.createDirectories(destinationPath.getParent());
Files.copy(zip, destinationPath);
Expand Down