changeset 3536:6bf1c5958c22

7009760: Possible stack corruption in Java_java_net_TwoStacksPlainSocketImpl_socketGetOption Summary: SOCKET_ADDRESS -> SOCKETADDRESS Reviewed-by: alanb
author chegar
date Fri, 07 Jan 2011 21:02:58 +0000
parents ddaffd64796c
children 3dbc783a8073
files src/windows/native/java/net/TwoStacksPlainSocketImpl.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/java/net/TwoStacksPlainSocketImpl.c	Fri Jan 07 15:51:26 2011 +0000
+++ b/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) {