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
This commit is contained in:
Daniel Stenberg 2026-04-24 08:11:10 +02:00
parent eea9ce45a4
commit 5c756684ba
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -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