jdk/src/share/classes/java/net/SocksSocketImpl.java
changeset 18212 22f8c33b0690
parent 14342 8435a30053c1
child 19069 1d9cb0d080e3
--- a/jdk/src/share/classes/java/net/SocksSocketImpl.java	Thu Mar 28 06:55:42 2013 -0400
+++ b/jdk/src/share/classes/java/net/SocksSocketImpl.java	Thu Mar 28 14:34:18 2013 -0700
@@ -28,6 +28,7 @@
 import java.io.OutputStream;
 import java.io.BufferedOutputStream;
 import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.security.PrivilegedExceptionAction;
 import sun.net.SocksProxy;
 import sun.net.www.ParseUtil;
@@ -590,7 +591,13 @@
         /* Test for AnyLocal */
         InetAddress naddr = baddr;
         if (naddr.isAnyLocalAddress()) {
-            naddr = cmdsock.getLocalAddress();
+            naddr = AccessController.doPrivileged(
+                        new PrivilegedAction<InetAddress>() {
+                            public InetAddress run() {
+                                return cmdsock.getLocalAddress();
+
+                            }
+                        });
             addr1 = naddr.getAddress();
         }
         out.write(PROTO_VERS4);