summaryrefslogtreecommitdiff
path: root/tests/select.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-03 19:11:58 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-03 19:11:58 +0100
commit9853b168f68cbb09b75a817343cedde2aca4c76c (patch)
treedb628840acea83dbccaf5676b89579a80e02ef51 /tests/select.c
parentd83e85a2e6064c36f6ad3c848e39d8b8c101c4f7 (diff)
parent7cf710f6587e71a193a55d84dd6d8ae1a8a69ce0 (diff)
Merge branch 'feature/upstream' into develop
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;