[libbluray-devel] Fix null pointer access in org.dvb.user.UserPreferenceManager
hpi1
git at videolan.org
Thu Dec 20 10:57:32 CET 2012
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Dec 20 11:36:15 2012 +0200| [820f15d0b31e0b36a23850c9be1645e3e3654d84] | committer: hpi1
Fix null pointer access in org.dvb.user.UserPreferenceManager
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=820f15d0b31e0b36a23850c9be1645e3e3654d84
---
.../bdj/java/org/dvb/user/UserPreferenceManager.java | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/libbluray/bdj/java/org/dvb/user/UserPreferenceManager.java b/src/libbluray/bdj/java/org/dvb/user/UserPreferenceManager.java
index d552965..239c966 100644
--- a/src/libbluray/bdj/java/org/dvb/user/UserPreferenceManager.java
+++ b/src/libbluray/bdj/java/org/dvb/user/UserPreferenceManager.java
@@ -37,7 +37,9 @@ public class UserPreferenceManager {
public void read(Preference p) {
SecurityManager sm = System.getSecurityManager();
- sm.checkPermission(new UserPreferencePermission("read"));
+ if (sm != null) {
+ sm.checkPermission(new UserPreferencePermission("read"));
+ }
p.removeAll();
String name = p.getName();
Iterator it = preferences.iterator();
@@ -52,7 +54,9 @@ public class UserPreferenceManager {
public void read(Preference p, Facility facility) {
SecurityManager sm = System.getSecurityManager();
- sm.checkPermission(new UserPreferencePermission("read"));
+ if (sm != null) {
+ sm.checkPermission(new UserPreferencePermission("read"));
+ }
p.removeAll();
String name = p.getName();
if (name.equals(facility.getPreference())) {
@@ -79,7 +83,9 @@ public class UserPreferenceManager {
if (!GeneralPreference.isGeneralPreference(name))
throw new UnsupportedPreferenceException();
SecurityManager sm = System.getSecurityManager();
- sm.checkPermission(new UserPreferencePermission("write"));
+ if (sm != null) {
+ sm.checkPermission(new UserPreferencePermission("write"));
+ }
Iterator it = preferences.iterator();
while (it.hasNext()) {
Preference preference = (Preference)it.next();
More information about the libbluray-devel
mailing list