From 3f786ebe76e67fcb3a725bf298c2d961a8e780d7 Mon Sep 17 00:00:00 2001 From: Sarah Harvey Date: Sat, 17 Aug 2024 19:42:02 -0400 Subject: [PATCH] Fix CodeQL issues --- src/main/java/sh/shh/midi/roland/BlobExtractor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/sh/shh/midi/roland/BlobExtractor.java b/src/main/java/sh/shh/midi/roland/BlobExtractor.java index 00025f4..c26673c 100644 --- a/src/main/java/sh/shh/midi/roland/BlobExtractor.java +++ b/src/main/java/sh/shh/midi/roland/BlobExtractor.java @@ -6,6 +6,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.nio.file.Path; import java.util.jar.JarEntry; import java.util.jar.JarFile; import java.util.regex.Matcher; @@ -26,7 +27,7 @@ static void extract(JarFile jarFile, JarEntry jarEntry, String outputDir) { try { Matcher matcher = REGEX.matcher(jarEntry.getName()); matcher.find(); - String extractedFileName = matcher.group(1); + String extractedFileName = Path.of(matcher.group(1)).normalize().toString(); File outputFile = new File(outputDir, extractedFileName); System.out.println("Extracting " + jarEntry.getName() + " -> " + outputFile.getPath()); if (!outputFile.exists()) {