From e47b6e657aa5dda6dfb79d495ba3ee7b0534532a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 3 Mar 2026 23:50:08 +0100 Subject: [PATCH] socketpair: clear 'err' when retrying due to EINTR If the first write was interrupted by a signal and a subsequent write succeeds, the function would still erroneously return EINTR. Found by Codex Security Closes #20809 --- lib/socketpair.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/socketpair.c b/lib/socketpair.c index 7fd7e30bba..76b959dd4a 100644 --- a/lib/socketpair.c +++ b/lib/socketpair.c @@ -317,6 +317,7 @@ int Curl_wakeup_signal(curl_socket_t socks[2]) #endif while(1) { + err = 0; if(wakeup_write(socks[1], buf, sizeof(buf)) < 0) { err = SOCKERRNO; #ifdef USE_WINSOCK