]> granicus.if.org Git - libevent/commitdiff
Zero a struct sockaddr_in before using it
authorSebastian Hahn <sebastian@torproject.org>
Sat, 23 Apr 2011 00:22:08 +0000 (02:22 +0200)
committerSebastian Hahn <sebastian@torproject.org>
Sat, 23 Apr 2011 00:22:08 +0000 (02:22 +0200)
Found by Dave Heart

test/bench_httpclient.c

index f0888e6caa32d695a456e36507e4badfed293074..87103cc87d84a6d428360537fbf718f203c79a84 100644 (file)
@@ -36,6 +36,7 @@
 # endif
 #endif
 #include <stdlib.h>
+#include <string.h>
 #include <errno.h>
 
 #include "event2/event.h"
@@ -130,6 +131,8 @@ launch_request(void)
 
        struct request_info *ri;
 
+       memset(&sin, 0, sizeof(sin));
+
        ++total_n_launched;
 
        sin.sin_family = AF_INET;