6887703: Unsigned applet can retrieve the dragged information before drop action occur
authordenis
Fri, 26 Feb 2010 03:54:52 -0800
changeset 5192 506ebd065f86
parent 5191 79b41f733e33
child 5193 44feb685d646
6887703: Unsigned applet can retrieve the dragged information before drop action occur Reviewed-by: uta
jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java
--- a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java	Mon Feb 22 14:33:19 2010 -0800
+++ b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java	Fri Feb 26 03:54:52 2010 -0800
@@ -57,6 +57,7 @@
 import sun.awt.SunToolkit;
 import sun.awt.datatransfer.DataTransferer;
 import sun.awt.datatransfer.ToolkitThreadBlockedHandler;
+import sun.security.util.SecurityConstants;
 
 /**
  * <p>
@@ -216,6 +217,18 @@
       throws UnsupportedFlavorException, IOException,
         InvalidDnDOperationException
     {
+
+        SecurityManager sm = System.getSecurityManager();
+        try {
+            if (!dropComplete && sm != null) {
+                sm.checkSystemClipboardAccess();
+            }
+        } catch (Exception e) {
+            Thread currentThread = Thread.currentThread();
+            currentThread.getUncaughtExceptionHandler().uncaughtException(currentThread, e);
+            return null;
+        }
+
         Long lFormat = null;
         Transferable localTransferable = local;