From 12b3084ecc9da5b768fb7c9a9180d54b3d24ee43 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 20 Jun 2013 20:09:43 +0200 Subject: Security: Tighten DynamicLinker*, NativeLibrary and DynamicLibraryBundle access. --- make/joal-common-CustomJavaCode.java | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'make/joal-common-CustomJavaCode.java') diff --git a/make/joal-common-CustomJavaCode.java b/make/joal-common-CustomJavaCode.java index 436f462..5df6cfd 100644 --- a/make/joal-common-CustomJavaCode.java +++ b/make/joal-common-CustomJavaCode.java @@ -9,19 +9,19 @@ static { alDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction() { public DynamicLibraryBundle run() { - return new DynamicLibraryBundle(new ALDynamicLibraryBundleInfo()); + final DynamicLibraryBundle bundle = new DynamicLibraryBundle(new ALDynamicLibraryBundleInfo()); + if(null==bundle) { + throw new RuntimeException("Null ALDynamicLookupHelper"); + } + if(!bundle.isToolLibLoaded()) { + throw new RuntimeException("Couln't load native AL library"); + } + if(!bundle.isLibComplete()) { + throw new RuntimeException("Couln't load native AL/JNI glue library"); + } + alProcAddressTable.reset(bundle); + return bundle; } } ); - - if(null==alDynamicLookupHelper) { - throw new RuntimeException("Null ALDynamicLookupHelper"); - } - if(!alDynamicLookupHelper.isToolLibLoaded()) { - throw new RuntimeException("Couln't load native AL library"); - } - if(!alDynamicLookupHelper.isLibComplete()) { - throw new RuntimeException("Couln't load native AL/JNI glue library"); - } - alProcAddressTable.reset(alDynamicLookupHelper); } public static ALProcAddressTable getALProcAddressTable() { return alProcAddressTable; } -- cgit v1.2.3