raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1dcac1853df5757ff360fb0e5adee7bb96bfd8eb

commit 1dcac1853df5757ff360fb0e5adee7bb96bfd8eb
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Thu Sep 28 12:29:46 2017 +0900

    efl ui focus - fix coverity complaints about derfer before null check
    
    indeed there was a child cnull check after dereferencing the child...
    so check completely. fix CID 1379925
---
 src/lib/elementary/efl_ui_focus_manager_calc.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/lib/elementary/efl_ui_focus_manager_calc.c 
b/src/lib/elementary/efl_ui_focus_manager_calc.c
index 9f5b36db3f..50323dd021 100644
--- a/src/lib/elementary/efl_ui_focus_manager_calc.c
+++ b/src/lib/elementary/efl_ui_focus_manager_calc.c
@@ -1477,13 +1477,16 @@ 
_efl_ui_focus_manager_calc_efl_ui_focus_manager_logical_end(Eo *obj EINA_UNUSED,
 
    //we need to return the most lower right element
 
-   while(T(child).children && !child->redirect_manager)
+   while ((child) && (T(child).children) && (!child->redirect_manager))
      child = eina_list_last_data_get(T(child).children);
-   while (child->type != NODE_TYPE_NORMAL && !child->redirect_manager)
+   while ((child) && (child->type != NODE_TYPE_NORMAL) && 
(!child->redirect_manager))
      child = _prev(child);
 
-   ret.is_regular_end = child->type == NODE_TYPE_NORMAL;
-   ret.element = child ? child->focusable : NULL;
+   if (child)
+     {
+        ret.is_regular_end = child->type == NODE_TYPE_NORMAL;
+        ret.element = child ? child->focusable : NULL;
+     }
    return ret;
 }
 

-- 


Reply via email to