Merge branch 'socks4a-buffer-overflow' into 'main'

gsocks4aproxy: Fix a single byte buffer overflow in connect messages

Closes #3461

See merge request GNOME/glib!4281
This commit is contained in:
Philip Withnall 2024-09-19 20:21:05 +00:00
commit 84b6f747cb

View File

@ -79,9 +79,9 @@ g_socks4a_proxy_init (GSocks4aProxy *proxy)
* +----+----+----+----+----+----+----+----+----+----+....+----+------+....+------+
* | VN | CD | DSTPORT | DSTIP | USERID |NULL| HOST | | NULL |
* +----+----+----+----+----+----+----+----+----+----+....+----+------+....+------+
* 1 1 2 4 variable 1 variable
* 1 1 2 4 variable 1 variable 1
*/
#define SOCKS4_CONN_MSG_LEN (9 + SOCKS4_MAX_LEN * 2)
#define SOCKS4_CONN_MSG_LEN (10 + SOCKS4_MAX_LEN * 2)
static gint
set_connect_msg (guint8 *msg,
const gchar *hostname,