From 3cf7c3ef441822c889356fd1812ebf2944a59851 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 25 Aug 2020 10:45:55 +0100 Subject: gentoo resync : 25.08.2020 --- .../privoxy/files/privoxy-3.0.28-null-termination.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 net-proxy/privoxy/files/privoxy-3.0.28-null-termination.patch (limited to 'net-proxy/privoxy/files/privoxy-3.0.28-null-termination.patch') diff --git a/net-proxy/privoxy/files/privoxy-3.0.28-null-termination.patch b/net-proxy/privoxy/files/privoxy-3.0.28-null-termination.patch new file mode 100644 index 000000000000..295b739a05f6 --- /dev/null +++ b/net-proxy/privoxy/files/privoxy-3.0.28-null-termination.patch @@ -0,0 +1,13 @@ +diff '--color=auto' -Naurd privoxy-3.0.28-stable.orig/gateway.c privoxy-3.0.28-stable/gateway.c +--- privoxy-3.0.28-stable.orig/gateway.c 2018-12-30 21:40:13.000000000 +0300 ++++ privoxy-3.0.28-stable/gateway.c 2020-07-11 14:55:15.442676106 +0300 +@@ -1103,7 +1103,8 @@ + cbuf[client_pos++] = (char)(hostlen & 0xffu); + assert(sizeof(cbuf) - client_pos > (size_t)255); + /* Using strncpy because we really want the nul byte padding. */ +- strncpy(cbuf + client_pos, target_host, sizeof(cbuf) - client_pos); ++ strncpy(cbuf + client_pos, target_host, sizeof(cbuf) - client_pos - 1); ++ cbuf[sizeof(cbuf)-1] = 0; + client_pos += (hostlen & 0xffu); + cbuf[client_pos++] = (char)((target_port >> 8) & 0xff); + cbuf[client_pos++] = (char)((target_port ) & 0xff); -- cgit v1.2.3