# HG changeset patch # User Kim Alvefur # Date 1780854159 -7200 # Node ID 3870f944dec4a7c7a5a0314539acdddbaa79ab46 # Parent 55a7143a58ecc8e973e5c8ee30f2077dcc4a5da9# Parent 75d09be04f130bd513a59f10ae2d736cd7141a79 Merge 13.0->trunk diff -r 55a7143a58ec -r 3870f944dec4 util-src/poll.c --- a/util-src/poll.c Fri Jun 05 16:24:55 2026 +0100 +++ b/util-src/poll.c Sun Jun 07 19:42:39 2026 +0200 @@ -234,6 +234,13 @@ #endif #ifdef USE_SELECT + if(fd >= FD_SETSIZE) { + luaL_pushfail(L); + lua_pushstring(L, strerror(EBADF)); + lua_pushinteger(L, EBADF); + return 3; + } + if(!FD_ISSET(fd, &state->all)) { luaL_pushfail(L); lua_pushstring(L, strerror(ENOENT)); @@ -327,6 +334,13 @@ #endif #ifdef USE_SELECT + if(fd >= FD_SETSIZE) { + luaL_pushfail(L); + lua_pushstring(L, strerror(EBADF)); + lua_pushinteger(L, EBADF); + return 3; + } + if(!FD_ISSET(fd, &state->all)) { luaL_pushfail(L); lua_pushstring(L, strerror(ENOENT));