BugZilla: 43337. PR_GetPeerName() asserts on NT NSPRPUB_CLIENT_BRANCH
authorlarryh%netscape.com
Thu, 22 Jun 2000 00:36:23 +0000
branchNSPRPUB_CLIENT_BRANCH
changeset 1436 742efe7f40a56faa539356360bc8b389bfd54edb
parent 1434 d7a01ae4eba5265b2e22652797c9f7ca3f39448f
child 1446 124ea8273b5238841d915c4d1a9ea1a1f814fd4e
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);