blob: 295b739a05f6e0652d6e4f2c482f9d2ac6eb8491 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
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);
|