klibc-bot for Ben Hutchings
2023-Jan-26 16:12 UTC
[klibc] [klibc:time64] select: Fix handling of NULL timeout when wrapping pselect()
Commit-ID: fcbb80e223c369467680536b71c781918e614219 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=fcbb80e223c369467680536b71c781918e614219 Author: Ben Hutchings <ben at decadent.org.uk> AuthorDate: Sat, 14 Jan 2023 03:43:16 +0100 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sun, 15 Jan 2023 21:28:18 +0100 [klibc] select: Fix handling of NULL timeout when wrapping pselect() If select() is called with no timeout, our implementation wrapping pselect() passes an uninitialised timespec buffer to pselect(). It should pass NULL. Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/klibc/select.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr/klibc/select.c b/usr/klibc/select.c index 7af28fee..8ad93a4b 100644 --- a/usr/klibc/select.c +++ b/usr/klibc/select.c @@ -21,7 +21,8 @@ int select(int nfds, fd_set *readfds, fd_set *writefds, ts.tv_nsec = timeout->tv_usec * 1000; } - result = __pselect6(nfds, readfds, writefds, exceptfds, &ts, NULL); + result = __pselect6(nfds, readfds, writefds, exceptfds, + timeout ? &ts : NULL, NULL); if (timeout) { timeout->tv_sec = ts.tv_sec;
Reasonably Related Threads
- [klibc:time64] select: Make all select calls wrappers for pselect6()
- [klibc:master] poll, select: fix style problems
- [PATCH] stubdom: permit compilation without lwip
- [PATCH 2/3] syscalls: Add syscalls needed by arm64
- [klibc:master] syscalls: Add syscalls needed by arm64