[Commits] [SCM] claws branch, master, updated. 3.16.0-197-ga6d7f31

ticho at claws-mail.org ticho at claws-mail.org
Sun Jun 10 23:09:34 CEST 2018


The branch, master has been updated
       via  a6d7f318ac05f98e4905aec1d189145faaa73c9c (commit)
      from  35fb89950dda7cc124f5ca3dec5d34dd54c29b0b (commit)

Summary of changes:
 src/common/proxy.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit a6d7f318ac05f98e4905aec1d189145faaa73c9c
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sun Jun 10 23:09:18 2018 +0200

    Fixed an off-by-one buffer overflow in proxy.c.

diff --git a/src/common/proxy.c b/src/common/proxy.c
index 7bde533..db21429 100644
--- a/src/common/proxy.c
+++ b/src/common/proxy.c
@@ -257,7 +257,7 @@ gint socks5_connect(SockInfo *sock, const gchar *hostname, gushort port,
 		} else if (socks_req[3] == 3) { /* Domain name */
 			gint hnlen = socks_req[4];
 			gchar *hn = malloc(hnlen + 1);
-			hn[hnlen + 1] = '\0';
+			hn[hnlen] = '\0';
 			memcpy(hn, &socks_req[5], hnlen);
 			g_warning("socks5_connect: SOCKS5 connection to %s:%u failed. (%u)",
 					hn, ntohs(*(gushort *)(socks_req + 5 + hnlen)), socks_req[1]);
@@ -265,7 +265,7 @@ gint socks5_connect(SockInfo *sock, const gchar *hostname, gushort port,
 		} else if (socks_req[3] == 4) { /* IPv6 address */
 			gint hnlen = 16;
 			gchar *hn = malloc(hnlen + 1);
-			hn[hnlen + 1] = '\0';
+			hn[hnlen] = '\0';
 			memcpy(hn, &socks_req[4], hnlen);
 			g_warning("socks5_connect: SOCKS5 connection to IPv6 %s:%u failed. (%u)",
 					hn, ntohs(*(gushort *)(socks_req + 5 + hnlen)), socks_req[1]);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list