Browse code

pike: memset of address print buffer with proper size

(cherry picked from commit d54eb083f59fb55ccbc79e49b5b3e05426bd3795)

Daniel-Constantin Mierla authored on 06/12/2013 17:30:49
Showing 1 changed files
... ...
@@ -13,14 +13,15 @@
13 13
 static struct TopListItem_t *top_list_root = 0;
14 14
 static struct TopListItem_t *top_list_iter = 0;
15 15
 
16
-static char buff[128];
16
+#define PIKE_BUFF_SIZE	128
17
+static char buff[PIKE_BUFF_SIZE];
17 18
 
18 19
 struct TopListItem_t *pike_top_get_root() { return top_list_root; }
19 20
 
20 21
 char *pike_top_print_addr( unsigned char *ip, int iplen, char *buff, int buffsize )
21 22
 {
22 23
 	unsigned short *ipv6_ptr = (unsigned short *)ip;
23
-	memset( buff, 0, sizeof(buff));
24
+	memset(buff, 0, PIKE_BUFF_SIZE*sizeof(char));
24 25
 	
25 26
 	DBG("pike:top:print_addr(iplen: %d, buffsize: %d)", iplen, buffsize);
26 27