From aa4bfb14ff04b95f21236f6c254603d64b0807cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Piotrowski?= <b@bpiotrowski.pl> Date: Mon, 15 Dec 2014 19:35:12 +0100 Subject: [PATCH] Terminate buffer with NULL The bug has been found by Coverity scan. (CWE-170) --- fanout.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fanout.c b/fanout.c index 4230e1e..d6056f5 100644 --- a/fanout.c +++ b/fanout.c @@ -610,6 +610,7 @@ resetting counter\n"); client_i->fd); memset (buffer, 0, sizeof (buffer)); res = recv (client_i->fd, buffer, 1024, 0); + buffer[1024] = '\0'; if (res <= 0) { fanout_debug (2, "client socket disconnected\n"); -- GitLab