diff options
author | Sven Gothel <[email protected]> | 2013-06-20 20:09:43 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-06-20 20:09:43 +0200 |
commit | 12b3084ecc9da5b768fb7c9a9180d54b3d24ee43 (patch) | |
tree | 5d44696c07f6a14d72024b44bb214bbe2b18e939 /make/joal-common-CustomJavaCode.java | |
parent | 55b5449ce106164e7f47b827cbe03a7831de9942 (diff) |
Security: Tighten DynamicLinker*, NativeLibrary and DynamicLibraryBundle access.
Diffstat (limited to 'make/joal-common-CustomJavaCode.java')
-rw-r--r-- | make/joal-common-CustomJavaCode.java | 24 |
1 files changed, 12 insertions, 12 deletions
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<DynamicLibraryBundle>() { 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; } |