summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-proxy/privoxy/files/privoxy-3.0.28-null-termination.patch')
-rw-r--r--net-proxy/privoxy/files/privoxy-3.0.28-null-termination.patch13
1 files changed, 13 insertions, 0 deletions
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);