diff options
author | Bruno Haible <bruno@clisp.org> | 2017-04-22 14:18:45 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2017-04-22 14:18:45 +0200 |
commit | 518ec8ea7911bab915789a40d4c25335ba724e70 (patch) | |
tree | 345342a22b4830699bcaf4ea3f0c0c1e37c34a44 /lib/poll.c | |
parent | 04e8f490345f99f6e9ac5c8ed403c7f095a52eb7 (diff) | |
download | gnulib-518ec8ea7911bab915789a40d4c25335ba724e70.tar.gz |
poll: Enable argument check.
* lib/poll.c: Include intprops.h.
(poll): Check value of nfd correctly.
* modules/poll (Depends-on): Add intprops.
Diffstat (limited to 'lib/poll.c')
-rw-r--r-- | lib/poll.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/poll.c b/lib/poll.c index 88d9292d5d..803ac0e171 100644 --- a/lib/poll.c +++ b/lib/poll.c @@ -60,6 +60,7 @@ #include <time.h> #include "assure.h" +#include "intprops.h" #ifndef INFTIM # define INFTIM (-1) @@ -335,7 +336,7 @@ poll (struct pollfd *pfd, nfds_t nfd, int timeout) int maxfd, rc; nfds_t i; - if (nfd < 0) + if (nfd > TYPE_MAXIMUM (nfds_t) / 2) { errno = EINVAL; return -1; |