zmike pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=36c5f1026f19b919180ea11a94eb86e7708fed15

commit 36c5f1026f19b919180ea11a94eb86e7708fed15
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Fri Oct 18 13:29:01 2019 -0400

    ecore/main: avoid calling FD_SET with invalid fd value
    
    Summary:
    it's possible that _ecore_get_epoll_fd() can return -1, so ensure that we
    correctly handle this
    
    CID 1383850
    
    Reviewers: devilhorns
    
    Reviewed By: devilhorns
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D10394
---
 src/lib/ecore/ecore_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index cdd51209a0..7e84d9d231 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -1825,7 +1825,8 @@ _ecore_main_select(Eo *obj, Efl_Loop_Data *pd, double 
timeout)
      {
         // polling on the epoll fd will wake when fd in the epoll set is active
         max_fd = _ecore_get_epoll_fd(obj, pd);
-        FD_SET(max_fd, &rfds);
+        if (max_fd > -1)
+          FD_SET(max_fd, &rfds);
      }
 #endif
    EINA_LIST_FOREACH(pd->file_fd_handlers, l, fdh)

-- 


Reply via email to