diff --git a/src/main/java/org/jboss/util/file/JarUtils.java b/src/main/java/org/jboss/util/file/JarUtils.java index 01ccdbf..e4ff2b3 100644 --- a/src/main/java/org/jboss/util/file/JarUtils.java +++ b/src/main/java/org/jboss/util/file/JarUtils.java @@ -282,7 +282,7 @@ public static void unjar(InputStream in, File dest) throws IOException fileName = fileName.replace('/', File.separatorChar); } File file = new File(dest, fileName); - if (!file.getCanonicalPath().startsWith(canonicalDocBasePrefix)) + if (!file.getCanonicalFile().toPath().startsWith(canonicalDocBasePrefix)) { throw new IOException("Illegal path: " + fileName); }