]> 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:46 +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 9c41f57541d74b6c9019fef72e28877e76208419..614fd200b7c0cd9d3e495d1286ad2c22f4683a6f 100644 (file)
@@ -267,6 +267,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;
     }