From 00893e79fc62966067af1a106567db96bd170338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 3 Mar 2024 19:11:32 +0100 Subject: New upstream version 1.2 --- tests/select.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/select.c') 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; -- cgit v1.2.3