7009760: Possible stack corruption in Java_java_net_TwoStacksPlainSocketImpl_socketGetOption
authorchegar
Fri, 07 Jan 2011 21:02:58 +0000
changeset 7969 1a6282ab0d2a
parent 7968 33304964ef5b
child 7970 af1579474d16
7009760: Possible stack corruption in Java_java_net_TwoStacksPlainSocketImpl_socketGetOption Summary: SOCKET_ADDRESS -> SOCKETADDRESS Reviewed-by: alanb
jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c
--- a/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c	Fri Jan 07 15:51:26 2011 +0000
+++ b/jdk/src/windows/native/java/net/TwoStacksPlainSocketImpl.c	Fri Jan 07 21:02:58 2011 +0000
@@ -1032,21 +1032,20 @@
      * SO_BINDADDR isn't a socket option
      */
     if (opt == java_net_SocketOptions_SO_BINDADDR) {
-        SOCKET_ADDRESS him;
+        SOCKETADDRESS him;
         int len;
         int port;
         jobject iaObj;
         jclass iaCntrClass;
         jfieldID iaFieldID;
 
-        len = sizeof(struct sockaddr_in);
+        len = sizeof(him);
 
         if (fd == -1) {
             /* must be an IPV6 only socket. Case where both sockets are != -1
              * is handled in java
              */
             fd = getFD1 (env, this);
-            len = sizeof(struct SOCKADDR_IN6);
         }
 
         if (getsockname(fd, (struct sockaddr *)&him, &len) < 0) {