[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r17749: {tor} Properly zero-out addresses when setting them. Probably this (tor/trunk/src/common)



Author: nickm
Date: 2008-12-23 09:21:34 -0500 (Tue, 23 Dec 2008)
New Revision: 17749

Modified:
   tor/trunk/src/common/address.c
Log:
Properly zero-out addresses when setting them.  Probably this was not hurting anything.

Modified: tor/trunk/src/common/address.c
===================================================================
--- tor/trunk/src/common/address.c	2008-12-23 13:57:20 UTC (rev 17748)
+++ tor/trunk/src/common/address.c	2008-12-23 14:21:34 UTC (rev 17749)
@@ -746,7 +746,7 @@
 tor_addr_from_ipv4n(tor_addr_t *dest, uint32_t v4addr)
 {
   tor_assert(dest);
-  memset(dest, 0, sizeof(dest));
+  memset(dest, 0, sizeof(tor_addr_t));
   dest->family = AF_INET;
   dest->addr.in_addr.s_addr = v4addr;
 }
@@ -758,7 +758,7 @@
 {
   tor_assert(dest);
   tor_assert(ipv6_bytes);
-  memset(dest, 0, sizeof(dest));
+  memset(dest, 0, sizeof(tor_addr_t));
   dest->family = AF_INET6;
   memcpy(dest->addr.in6_addr.s6_addr, ipv6_bytes, 16);
 }