From 5c756684ba781c48b3a8f858c4c6299c848c86de Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 24 Apr 2026 08:11:10 +0200 Subject: [PATCH] hostip: init the curl_jmpenv_lock appropriately A zero-initialized static value is not guaranteed to be a valid mutex on all POSIX implementations Spotted by Codex Security Closes #21432 --- lib/hostip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hostip.c b/lib/hostip.c index 48942d4bda..e547a8e450 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -201,7 +201,7 @@ void Curl_printable_address(const struct Curl_addrinfo *ai, char *buf, return address that we can jump back to from inside a signal handler. This is not thread-safe stuff. */ static sigjmp_buf curl_jmpenv; -static curl_simple_lock curl_jmpenv_lock; +static curl_simple_lock curl_jmpenv_lock = CURL_SIMPLE_LOCK_INIT; #endif #ifdef USE_IPV6