From: Tomas Mraz Date: Mon, 14 Oct 2024 11:26:07 +0000 (+0200) Subject: SSL_poll(): Handle blocking with no poll items X-Git-Tag: openssl-3.5.0-alpha1~332 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6cb1b4e89eb29a90c7a98575abe27d86d29c44bd;p=thirdparty%2Fopenssl.git SSL_poll(): Handle blocking with no poll items Reviewed-by: Matt Caswell Reviewed-by: Saša Nedvědický (Merged from https://github.com/openssl/openssl/pull/25416) --- diff --git a/ssl/rio/poll_immediate.c b/ssl/rio/poll_immediate.c index 76b2db7a807..fb18e9e5fea 100644 --- a/ssl/rio/poll_immediate.c +++ b/ssl/rio/poll_immediate.c @@ -412,8 +412,12 @@ int SSL_poll(SSL_POLL_ITEM *items, OSSL_TIME deadline; /* Trivial case. */ - if (num_items == 0) + if (num_items == 0) { + if (timeout == NULL) + goto out; + OSSL_sleep(ossl_time2ms(ossl_time_from_timeval(*timeout))); goto out; + } /* Convert timeout to deadline. */ if (timeout == NULL)