changeset 2398:7a6b3cc68e92

6887703: Unsigned applet can retrieve the dragged information before drop action occur Reviewed-by: uta
author denis
date Fri, 26 Feb 2010 03:54:52 -0800
parents cda01c4b091c
children c5c6f8fa92ae
files src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java	Mon Feb 22 14:33:19 2010 -0800
+++ b/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;