6887703: Unsigned applet can retrieve the dragged information before drop action occur
Reviewed-by: uta
--- 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;