summaryrefslogtreecommitdiffstats
path: root/crypto/bio/bio_sock.c
diff options
context:
space:
mode:
authorolszomal <Malgorzata.Olszowka@stunnel.org>2024-04-04 11:34:33 +0200
committerTomas Mraz <tomas@openssl.org>2024-04-10 09:25:52 +0200
commit77b8154b4359a6ed4686d4cb7373b606d179a4ad (patch)
treef997bc3168887dfa84e7182be47e8353fd08d674 /crypto/bio/bio_sock.c
parente9bf4c720873011c439be2f12fb7e057b4e9ea61 (diff)
Fix socket descriptor checks on Windows
Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24035) (cherry picked from commit c89baf871030c811ba316ccbdcea26c294f605ae)
Diffstat (limited to 'crypto/bio/bio_sock.c')
-rw-r--r--crypto/bio/bio_sock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/bio/bio_sock.c b/crypto/bio/bio_sock.c
index ee3ee5b78f..a55ecc22c1 100644
--- a/crypto/bio/bio_sock.c
+++ b/crypto/bio/bio_sock.c
@@ -435,7 +435,11 @@ int BIO_socket_wait(int fd, int for_read, time_t max_time)
struct timeval tv;
time_t now;
+#ifdef _WIN32
+ if ((SOCKET)fd == INVALID_SOCKET)
+#else
if (fd < 0 || fd >= FD_SETSIZE)
+#endif
return -1;
if (max_time == 0)
return 1;