diff --git a/fj-doc-playground-quarkus/src/main/java/org/fugerit/java/doc/playground/init/ProjectRest.java b/fj-doc-playground-quarkus/src/main/java/org/fugerit/java/doc/playground/init/ProjectRest.java index 000f34714..97e81b685 100644 --- a/fj-doc-playground-quarkus/src/main/java/org/fugerit/java/doc/playground/init/ProjectRest.java +++ b/fj-doc-playground-quarkus/src/main/java/org/fugerit/java/doc/playground/init/ProjectRest.java @@ -109,6 +109,7 @@ public static void checkIfInTempFolder( File file ) throws IOException { } } public static void zipFolder(File sourceFolder, OutputStream fos) throws IOException { + checkIfInTempFolder( sourceFolder ); // security check ZipOutputStream zos = new ZipOutputStream(fos); // Ensure the source folder exists if (!sourceFolder.exists()) { @@ -120,6 +121,7 @@ public static void zipFolder(File sourceFolder, OutputStream fos) throws IOExcep fos.close(); } private static void zipFile(File fileToZip, String fileName, ZipOutputStream zos) throws IOException { + checkIfInTempFolder( fileToZip ); // security check if (fileToZip.isDirectory()) { zos.putNextEntry(new ZipEntry( ensureEndWithSlash( fileName ) )); zos.closeEntry();