]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
use_proxy(): Add missing terminating NUL byte
authorTomas Mraz <tomas@openssl.org>
Thu, 11 Sep 2025 16:43:55 +0000 (18:43 +0200)
committerTomas Mraz <tomas@openssl.org>
Mon, 29 Sep 2025 10:04:32 +0000 (12:04 +0200)
Fixes CVE-2025-9232

There is a missing terminating NUL byte after strncpy() call.
Issue and a proposed fix reported by Stanislav Fort (Aisle Research).

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 6bca15039e99d37ce3a3564eb862a3b1ff40e63d)

crypto/http/http_lib.c

index 4838d3ae2e6f52df1b47f65154e166747e918c5d..9b1c39b39a9bf93f947bcd9086573f022e4ea2fb 100644 (file)
@@ -261,6 +261,7 @@ static int use_proxy(const char *no_proxy, const char *server)
         /* strip leading '[' and trailing ']' from escaped IPv6 address */
         sl -= 2;
         strncpy(host, server + 1, sl);
+        host[sl] = '\0';
         server = host;
     }