diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-03-24 08:54:48 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-03-24 08:54:48 +0100 |
commit | 163a663518f33bab48b28431972e580b366b4d49 (patch) | |
tree | f518ffabaca4a0b93f0103d617e803792d3b0b43 /tests/select.c | |
parent | 1b3a8d5ad2ea2f099d514d9dd51ebf926a628076 (diff) | |
parent | dd0000f7e25abe6c28d4329d324fd7fcab54094f (diff) |
Merge branch 'release/debian/1.2-1'HEADdebian/1.2-1master
Diffstat (limited to 'tests/select.c')
-rw-r--r-- | tests/select.c | 9 |
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; |