diff options
author | Kim Alvefur <zash@zash.se> | 2016-08-18 17:16:21 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-08-18 17:16:21 +0200 |
commit | 7b734a63a00edba3fe499c6fedcf045dd27baf1e (patch) | |
tree | 2d7543d07a74d8008ac0b103696b1a7b3f025976 /net/server_epoll.lua | |
parent | 85891f31602f609c78ba53954358227371495b49 (diff) | |
download | prosody-7b734a63a00edba3fe499c6fedcf045dd27baf1e.tar.gz prosody-7b734a63a00edba3fe499c6fedcf045dd27baf1e.zip |
net.server_epoll: Prevent invalid FDs from being added to epoll
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r-- | net/server_epoll.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua index e85947ae..7d279035 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -246,6 +246,10 @@ function interface:setflags(r, w) return true; end local fd = self:getfd(); + if fd < 0 then + self._wantread, self._wantwrite = nil, nil; + return nil, "invalid fd"; + end local op = "mod"; if not flags then op = "del"; |