diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-12-23 14:21:34 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-12-23 14:21:34 +0000 |
commit | d7f55dafe0287c1a8c13478c4e077da65533769c (patch) | |
tree | a4bc04fcaa6fd8d4528a9834a071ad81f601d073 /src/common/address.c | |
parent | b4d387c28bbcfabfc8baa1b63db396888534519a (diff) | |
download | tor-d7f55dafe0287c1a8c13478c4e077da65533769c.tar.gz tor-d7f55dafe0287c1a8c13478c4e077da65533769c.zip |
Properly zero-out addresses when setting them. Probably this was not hurting anything.
svn:r17749
Diffstat (limited to 'src/common/address.c')
-rw-r--r-- | src/common/address.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/address.c b/src/common/address.c index df4c3f5701..67eb07f3a1 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -746,7 +746,7 @@ void 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_addr_from_ipv6_bytes(tor_addr_t *dest, const char *ipv6_bytes) { 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); } |