summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-10-18 13:29:01 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-10-18 13:29:01 -0400
commit36c5f1026f19b919180ea11a94eb86e7708fed15 (patch)
treeb196acc71b15b82d59618ac86591269f6715c9aa
parent39f384bba191218ec35240fbf73247bc27eb10d6 (diff)
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
-rw-r--r--src/lib/ecore/ecore_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index cdd5120..7e84d9d 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)
1825 { 1825 {
1826 // polling on the epoll fd will wake when fd in the epoll set is active 1826 // polling on the epoll fd will wake when fd in the epoll set is active
1827 max_fd = _ecore_get_epoll_fd(obj, pd); 1827 max_fd = _ecore_get_epoll_fd(obj, pd);
1828 FD_SET(max_fd, &rfds); 1828 if (max_fd > -1)
1829 FD_SET(max_fd, &rfds);
1829 } 1830 }
1830#endif 1831#endif
1831 EINA_LIST_FOREACH(pd->file_fd_handlers, l, fdh) 1832 EINA_LIST_FOREACH(pd->file_fd_handlers, l, fdh)