Chromium Code Reviews

Unified Diff: net/base/nss_memio.c

Issue 1589001: memio_SetPeerName implicitly assumes that struct sockaddr is the same as... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « net/base/nss_memio.h ('k') | net/socket/ssl_client_socket_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/nss_memio.c
===================================================================
--- net/base/nss_memio.c (revision 42853)
+++ net/base/nss_memio.c (working copy)
@@ -359,17 +359,11 @@
return fd;
}
-void memio_SetPeerName(PRFileDesc *fd, const struct sockaddr *peername,
- size_t peername_len)
+void memio_SetPeerName(PRFileDesc *fd, const PRNetAddr *peername)
{
PRFileDesc *memiofd = PR_GetIdentitiesLayer(fd, memio_identity);
- struct PRFilePrivate *secret = memiofd->secret;
- size_t len;
-
- memset(&secret->peername, 0, sizeof(secret->peername));
- PR_ASSERT(peername_len <= sizeof(secret->peername));
- len = PR_MIN(peername_len, sizeof(secret->peername));
- memcpy(&secret->peername, peername, len);
+ struct PRFilePrivate *secret = memiofd->secret;
+ secret->peername = *peername;
}
memio_Private *memio_GetSecret(PRFileDesc *fd)
« no previous file with comments | « net/base/nss_memio.h ('k') | net/socket/ssl_client_socket_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine