diff util-src/poll.c @ 10096:46a7792fdac5

util.poll: Add missing return statements in fallback mode These allowed modifying or deleting select() state for unregistered FDs. During normal usage this should never happen. Modifying one that isn't set might cause weirdness but deleting an already deleted FD isn't a problem.
author Kim Alvefur <zash@zash.se>
date Sun, 28 Jul 2019 16:17:23 +0200
parents 36280801ddf1
children 6eb5d2bb11af
line wrap: on
line diff
--- a/util-src/poll.c	Sun Jul 28 01:43:10 2019 +0200
+++ b/util-src/poll.c	Sun Jul 28 16:17:23 2019 +0200
@@ -172,6 +172,7 @@
 		lua_pushnil(L);
 		lua_pushstring(L, strerror(ENOENT));
 		lua_pushinteger(L, ENOENT);
+		return 3;
 	}
 
 	if(!lua_isnoneornil(L, 3)) {
@@ -229,6 +230,7 @@
 		lua_pushnil(L);
 		lua_pushstring(L, strerror(ENOENT));
 		lua_pushinteger(L, ENOENT);
+		return 3;
 	}
 
 	FD_CLR(fd, &state->wantread);