devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=35f76fe8a8988d3664628cf83f3ea77a7cbb5c76

commit 35f76fe8a8988d3664628cf83f3ea77a7cbb5c76
Author: Chris Michael <cpmich...@osg.samsung.com>
Date:   Thu Jun 30 11:05:14 2016 -0400

    ecore-wl2: Check the return value of ecore_main_fd_handler_fd_get
    
    This patch fixes an issue where ecore_main_fd_handler_fd_get could be
    returning a negative number and passing that to close() which cannot
    accept negative numbers.
    
    Fixes Coverity CID1357152
    
    @fix
    
    Signed-off-by: Chris Michael <cpmich...@osg.samsung.com>
---
 src/lib/ecore_wl2/ecore_wl2_dnd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_wl2/ecore_wl2_dnd.c 
b/src/lib/ecore_wl2/ecore_wl2_dnd.c
index 993f899..b885356 100644
--- a/src/lib/ecore_wl2/ecore_wl2_dnd.c
+++ b/src/lib/ecore_wl2/ecore_wl2_dnd.c
@@ -449,7 +449,11 @@ _ecore_wl2_dnd_del(Ecore_Wl2_Dnd_Source *source)
    if (!source) return;
    if (source->fdh)
      {
-        close(ecore_main_fd_handler_fd_get(source->fdh));
+        int fd;
+
+        fd = ecore_main_fd_handler_fd_get(source->fdh);
+        if (fd >= 0)
+          close(ecore_main_fd_handler_fd_get(source->fdh));
         ecore_main_fd_handler_del(source->fdh);
      }
    wl_data_offer_destroy(source->offer);

-- 


Reply via email to