From ec0b708b981af77fef8e4bbb603cde4de4cd2e29 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Thu, 19 Sep 2024 18:35:53 +0100 Subject: [PATCH 1/2] gsocks4aproxy: Fix a single byte buffer overflow in connect messages `SOCKS4_CONN_MSG_LEN` failed to account for the length of the final nul byte in the connect message, which is an addition in SOCKSv4a vs SOCKSv4. This means that the buffer for building and transmitting the connect message could be overflowed if the username and hostname are both `SOCKS4_MAX_LEN` (255) bytes long. Proxy configurations are normally statically configured, so the username is very unlikely to be near its maximum length, and hence this overflow is unlikely to be triggered in practice. (Commit message by Philip Withnall, diagnosis and fix by Michael Catanzaro.) Fixes: #3461 --- gio/gsocks4aproxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gio/gsocks4aproxy.c b/gio/gsocks4aproxy.c index 3dad118eb..b3146d08f 100644 --- a/gio/gsocks4aproxy.c +++ b/gio/gsocks4aproxy.c @@ -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, From f53843043eb6d9ca18c461b1d4103232f3fe83c3 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 12 Sep 2024 21:40:41 +0100 Subject: [PATCH 2/2] ci: Force submodules to be fetched first in VS2017 CI jobs No idea why this is now suddenly not working. Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7726fa7af..06b81571e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -571,6 +571,8 @@ vs2017-x64: - win32-ps needs: [] variables: + GIT_SUBMODULE_STRATEGY: recursive + GIT_SUBMODULE_DEPTH: 1 PYTHONUTF8: "1" script: # FIXME: These should use --wrap-mode=nodownload but the Windows CI machines @@ -602,6 +604,8 @@ vs2017-x64-static: - win32-ps needs: [] variables: + GIT_SUBMODULE_STRATEGY: recursive + GIT_SUBMODULE_DEPTH: 1 PYTHONUTF8: "1" script: # FIXME: These should use --wrap-mode=nodownload but the Windows CI machines