From 96648a6fadf520e0b928f422dc3e32d63e86e8bf Mon Sep 17 00:00:00 2001 From: kappa1 Date: Wed, 15 Jun 2011 21:15:58 +0000 Subject: [PATCH] AppletLoader: validate certificate for native files before attempting to extract them. --- src/java/org/lwjgl/util/applet/AppletLoader.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java/org/lwjgl/util/applet/AppletLoader.java b/src/java/org/lwjgl/util/applet/AppletLoader.java index 8515a5d7..3a0bbca6 100644 --- a/src/java/org/lwjgl/util/applet/AppletLoader.java +++ b/src/java/org/lwjgl/util/applet/AppletLoader.java @@ -1662,6 +1662,9 @@ public class AppletLoader extends Applet implements Runnable, AppletStub { InputStream in = jarFile.getInputStream(jarFile.getEntry(entry.getName())); OutputStream out = new FileOutputStream(path + "natives" + File.separator + entry.getName()); + // validate if the certificate for native file is correct before extracting + validateCertificateChain(certificate, entry.getCertificates()); + int bufferSize; byte buffer[] = new byte[65536]; @@ -1675,9 +1678,6 @@ public class AppletLoader extends Applet implements Runnable, AppletStub { subtaskMessage = "Extracting: " + entry.getName() + " " + ((currentSizeExtract * 100) / totalSizeExtract) + "%"; } - // validate if the certificate for native file is correct - validateCertificateChain(certificate, entry.getCertificates()); - in.close(); out.close(); }