]> granicus.if.org Git - libevent/commitdiff
memset sockaddr_in before using it. Found by coverity.
authorNick Mathewson <nickm@torproject.org>
Thu, 26 Jul 2012 14:38:29 +0000 (10:38 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 26 Jul 2012 14:38:29 +0000 (10:38 -0400)
evdns.c

diff --git a/evdns.c b/evdns.c
index 416137ba25b987167a285a625bea1f117debefd7..d648c936cc0a84ff342aea122d240d6cf47178e3 100644 (file)
--- a/evdns.c
+++ b/evdns.c
@@ -2529,6 +2529,7 @@ evdns_base_nameserver_add(struct evdns_base *base, unsigned long int address)
 {
        struct sockaddr_in sin;
        int res;
+       memset(&sin, 0, sizeof(sin));
        sin.sin_addr.s_addr = address;
        sin.sin_port = htons(53);
        sin.sin_family = AF_INET;