BugZilla: 43337. PR_GetPeerName() asserts on NT NSPRPUB_RELEASE_4_0_BRANCH
authorlarryh%netscape.com
Thu, 22 Jun 2000 00:42:05 +0000
branchNSPRPUB_RELEASE_4_0_BRANCH
changeset 1438 e4191581e60c694cc52c480e49d44cf62157325b
parent 1435 c6e7da36477a881bd9aa917a6f56d7bd44f413cd
child 1447 6d4ac1e848fcc6402367e96cd5d908ef3a91565f
push idunknown
push userunknown
push dateunknown
bugs43337
BugZilla: 43337. PR_GetPeerName() asserts on NT
pr/src/md/windows/ntio.c
--- a/pr/src/md/windows/ntio.c
+++ b/pr/src/md/windows/ntio.c
@@ -2039,18 +2039,18 @@ PRStatus
                         SO_CONNECT_TIME,
                         (char *) &seconds,
                         (PINT) &bytes);
         if (rv == NO_ERROR) {
             if (seconds == 0xffffffff) {
                 PR_SetError(PR_NOT_CONNECTED_ERROR, 0);
                 return PR_FAILURE;
             }
+            memcpy(addr, &fd->secret->md.peer_addr, *len);
             *len = PR_NETADDR_SIZE(addr);
-            memcpy(addr, &fd->secret->md.peer_addr, *len);
             return PR_SUCCESS;
         } else {
             _PR_MD_MAP_GETSOCKOPT_ERROR(WSAGetLastError());
             return PR_FAILURE;
         }
     } else { 
         rv = getpeername((SOCKET)fd->secret->md.osfd,
                          (struct sockaddr *) addr, len);