summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/upoll.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/upoll.cpp b/src/upoll.cpp
index c4aa0a1..592cc42 100644
--- a/src/upoll.cpp
+++ b/src/upoll.cpp
@@ -56,10 +56,12 @@
#include <unistd.h>
#endif
+#include <limits.h>
+
int xs::upoll (xs_pollitem_t *items_, int nitems_, long timeout_)
{
#if defined XS_POLL_BASED_ON_POLL
- if (unlikely (nitems_ < 0)) {
+ if (unlikely (nitems_ < 0 || timeout_ > INT_MAX)) {
errno = EINVAL;
return -1;
}