From a2f6609d578cbc195b0d55e0744fe83996798d82 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Mon, 4 Dec 2017 23:21:39 +0100 Subject: [PATCH] api: report EINVAL if epoll_wait() is called with invalid `maxevents` --- src/api.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/api.c b/src/api.c index dce2fe5..10438de 100644 --- a/src/api.c +++ b/src/api.c @@ -105,6 +105,9 @@ int epoll_wait(HANDLE ephnd, ep_port_t* port_info; int result; + if (maxevents <= 0) + return_error(-1, ERROR_INVALID_PARAMETER); + if (init() < 0) return -1;