[Commits] [SCM] claws branch, master, updated. 3.16.0-114-g171d899

wwp at claws-mail.org wwp at claws-mail.org
Wed Apr 11 08:42:32 CEST 2018


The branch, master has been updated
       via  171d89917efbe3aa18324e831baaeaadb01dd2a7 (commit)
      from  6dcf3e1426374286dad4927a3e45ebb7e60be58b (commit)

Summary of changes:
 src/plugins/clamd/libclamd/clamd-plugin.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 171d89917efbe3aa18324e831baaeaadb01dd2a7
Author: wwp <wwp at free.fr>
Date:   Wed Apr 11 08:40:57 2018 +0200

    Fix buffer overrun, always writing at buffer size + 1.
    Fixes CID #1434188.

diff --git a/src/plugins/clamd/libclamd/clamd-plugin.c b/src/plugins/clamd/libclamd/clamd-plugin.c
index 314f626..d88b131 100644
--- a/src/plugins/clamd/libclamd/clamd-plugin.c
+++ b/src/plugins/clamd/libclamd/clamd-plugin.c
@@ -461,7 +461,7 @@ static Clamd_Stat clamd_stream_scan(int sock,
 		return NO_CONNECTION;
 	}
 
-	while ((count = read(fd, (void *) buf, sizeof(buf))) > 0) {
+	while ((count = read(fd, (void *) buf, BUFSIZ - 1)) > 0) {
 		buf[count] = '\0';
 		if (buf[count - 1] == '\n')
 			buf[count - 1] = '\0';
@@ -478,7 +478,7 @@ static Clamd_Stat clamd_stream_scan(int sock,
 			*res = g_strconcat("ERROR -> ", _("Socket write error"), NULL);
 			return SCAN_ERROR;
 		}
-		memset(buf, '\0', sizeof(buf));
+		memset(buf, '\0', BUFSIZ - 1);
 	}
 	if (count == -1) {
 		close(fd);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list