Commit 7a168148 authored by Skylot's avatar Skylot

core: fix class file loading (#249)

parent 23553c99
...@@ -176,7 +176,7 @@ public class InputFile { ...@@ -176,7 +176,7 @@ public class InputFile {
File outFile = FileUtils.createTempFile("cls.jar"); File outFile = FileUtils.createTempFile("cls.jar");
try (JarOutputStream jo = new JarOutputStream(new FileOutputStream(outFile))) { try (JarOutputStream jo = new JarOutputStream(new FileOutputStream(outFile))) {
String clsName = AsmUtils.getNameFromClassFile(file); String clsName = AsmUtils.getNameFromClassFile(file);
if (clsName == null || ZipSecurity.isValidZipEntryName(clsName)) { if (clsName == null || !ZipSecurity.isValidZipEntryName(clsName)) {
throw new IOException("Can't read class name from file: " + file); throw new IOException("Can't read class name from file: " + file);
} }
FileUtils.addFileToJar(jo, file, clsName + ".class"); FileUtils.addFileToJar(jo, file, clsName + ".class");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment