quagga: zero-out the extra allocated buffer size
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 15 Oct 2015 17:57:47 +0000 (19:57 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 15 Oct 2015 17:58:30 +0000 (19:58 +0200)
Might fix a Coverity warning

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/quagga/src/client.c

index 1297692..9d25ff8 100644 (file)
@@ -167,8 +167,10 @@ zclient_read(ssize_t * size)
 
     /* (re)allocate buffer */
     if (*size == bufsize) {
+      ssize_t start = bufsize;
       bufsize += BUFSIZE;
       buf = my_realloc(buf, bufsize, "QUAGGA: Grow read buffer");
+      memset(&buf[start], 0, BUFSIZE);
     }
 
     /* read from socket */