summaryrefslogtreecommitdiff
blob: 0d94674ce5a3105850dd27c29da51f6bd877813c (plain)
1
2
3
4
5
6
7
8
9
10
11
--- a/ping.c
+++ b/ping.c
@@ -813,7 +813,7 @@
 	int    rv;
 
 	buf = malloc(len*sizeof(char));
-	memset(buf, 0, sizeof(buf));
+	memset(buf, 0, len*sizeof(char));
 
 	while (1) {
 		rv = gethostbyname_r(hostname, &result_buf, buf, len,