libc: handle nullptr timeout in 'ppoll()'

Fixes #3790
This commit is contained in:
Christian Prochaska 2020-05-15 20:01:13 +02:00 committed by Norman Feske
parent 1ec823bf5e
commit 9578fadae2

View File

@ -124,7 +124,9 @@ int ppoll(struct pollfd fds[], nfds_t nfds,
const struct timespec *timeout,
const sigset_t*)
{
int timeout_ms = timeout->tv_sec * 1000 + timeout->tv_nsec / 1000;
int timeout_ms = timeout ?
(timeout->tv_sec * 1000 + timeout->tv_nsec / 1000) :
-1;
return poll(fds, nfds, timeout_ms);
}