Skip to content

Commit

Permalink
Merge nested ifs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-sexenian committed Jun 10, 2024
1 parent 39180c2 commit 5f5233e
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,8 @@ public static void decompressJar(File jarFile, String outputPath) throws IOExcep
byte[] buffer = new byte[1024];
while ((entry = jis.getNextJarEntry()) != null) {
File outputFile = new File(outputDir, entry.getName());

Check failure

Code scanning / CodeQL

Arbitrary file access during archive extraction ("Zip Slip") High

Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
Unsanitized archive entry, which may contain '..', is used in a
file system operation
.
if (entry.isDirectory()) {
if (!outputFile.exists() && !outputFile.mkdirs()) {
throw new IOException("Failed to create directory " + outputFile.getAbsolutePath());
}
if (entry.isDirectory() && !outputFile.exists() && !outputFile.mkdirs()) {
throw new IOException("Failed to create directory " + outputFile.getAbsolutePath());
} else {
try (FileOutputStream fos = new FileOutputStream(outputFile)) {
int len;
Expand Down

0 comments on commit 5f5233e

Please sign in to comment.