Bug 1330490 - clear entire PRNetAddr struct in PR_InitializeNetAddr for IPv6. r=ted
authorShih-Chiang Chien <schien@mozilla.com>
Mon, 13 Feb 2017 14:13:27 +0800
changeset 4707 2f1bfbcc79baac751f8bd83a9f799f33366b8d3a
parent 4706 56a754a74f38c0f10adbc41bc3abaf483a45b3bf
child 4708 bdc2f42edf03e1bec3e52026a40a9c84467e9499
push id231
push userkaie@kuix.de
push dateWed, 08 Mar 2017 10:52:06 +0000
reviewersted
bugs1330490
Bug 1330490 - clear entire PRNetAddr struct in PR_InitializeNetAddr for IPv6. r=ted
pr/src/misc/prnetdb.c
--- a/pr/src/misc/prnetdb.c
+++ b/pr/src/misc/prnetdb.c
@@ -1400,17 +1400,17 @@ PR_IMPLEMENT(PRIntn) PR_EnumerateHostEnt
 }  /* PR_EnumerateHostEnt */
 
 PR_IMPLEMENT(PRStatus) PR_InitializeNetAddr(
     PRNetAddrValue val, PRUint16 port, PRNetAddr *addr)
 {
     PRStatus rv = PR_SUCCESS;
     if (!_pr_initialized) _PR_ImplicitInitialization();
 
-	if (val != PR_IpAddrNull) memset(addr, 0, sizeof(addr->inet));
+	if (val != PR_IpAddrNull) memset(addr, 0, sizeof(*addr));
 	addr->inet.family = AF_INET;
 	addr->inet.port = htons(port);
 	switch (val)
 	{
 	case PR_IpAddrNull:
 		break;  /* don't overwrite the address */
 	case PR_IpAddrAny:
 		addr->inet.ip = htonl(INADDR_ANY);