summaryrefslogtreecommitdiff
path: root/tests/select.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-03 19:11:32 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-03 19:11:32 +0100
commit00893e79fc62966067af1a106567db96bd170338 (patch)
tree52b35cd0b42ca28e62a2ffbecade2e13dd8332cf /tests/select.c
parent26112352a774737e1ce5580c93654a26c1e82b39 (diff)
New upstream version 1.2upstream/1.2
Diffstat (limited to 'tests/select.c')
-rw-r--r--tests/select.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/select.c b/tests/select.c
index c2424982..5f7a5d00 100644
--- a/tests/select.c
+++ b/tests/select.c
@@ -1,7 +1,7 @@
/* Emulation for select(2)
Contributed by Paolo Bonzini.
- Copyright 2008-2022 Free Software Foundation, Inc.
+ Copyright 2008-2024 Free Software Foundation, Inc.
This file is part of gnulib.
@@ -279,8 +279,11 @@ rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
int i, fd, rc;
clock_t tend;
- if (nfds > FD_SETSIZE)
- nfds = FD_SETSIZE;
+ if (nfds < 0 || nfds > FD_SETSIZE)
+ {
+ errno = EINVAL;
+ return -1;
+ }
if (!timeout)
wait_timeout = INFINITE;