[libbluray-devel] ServiceContextFactory.getServiceContexts() should not throw security exceptions

hpi1 git at videolan.org
Wed Jun 3 10:37:50 CEST 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Jun  2 14:09:32 2015 +0300| [e0331bf6cee7055bfe86e53d9ad71e3ce779b5ce] | committer: hpi1

ServiceContextFactory.getServiceContexts() should not throw security exceptions

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=e0331bf6cee7055bfe86e53d9ad71e3ce779b5ce
---

 .../tv/service/selection/ServiceContextFactoryImpl.java  |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/libbluray/bdj/java/javax/tv/service/selection/ServiceContextFactoryImpl.java b/src/libbluray/bdj/java/javax/tv/service/selection/ServiceContextFactoryImpl.java
index 5bbaa88..a360770 100644
--- a/src/libbluray/bdj/java/javax/tv/service/selection/ServiceContextFactoryImpl.java
+++ b/src/libbluray/bdj/java/javax/tv/service/selection/ServiceContextFactoryImpl.java
@@ -62,10 +62,16 @@ public class ServiceContextFactoryImpl extends ServiceContextFactory {
     }
 
     public ServiceContext[] getServiceContexts() {
-        SecurityManager sec = System.getSecurityManager();
-        if (sec != null)
-            sec.checkPermission(new ServiceContextPermission("access", "own"));
-        return serviceContexts;
+        try {
+            SecurityManager sec = System.getSecurityManager();
+            if (sec != null)
+                sec.checkPermission(new ServiceContextPermission("access", "own"));
+            return serviceContexts;
+
+        } catch (Exception e) {
+        }
+
+        return new ServiceContext[0];
     }
 
     private ServiceContext[] serviceContexts;



More information about the libbluray-devel mailing list