devilhorns pushed a commit to branch master.

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

commit fa5e4c252fe47aafb4f88351d101f829091086cc
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Thu Oct 13 12:50:12 2016 -0400

    evas: Fix directly dereferencing pointer which may be NULL
    
    Coverity reports this as a dereference before null check which implies
    that 'cur' May be null here, so let's not use it before we check it.
    
    Fixes CID1363765
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/evas/canvas/evas_object_textblock.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 2b01c0a..29d8cb9 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -12185,10 +12185,12 @@ EAPI Eina_List *
 evas_textblock_cursor_range_geometry_get(const Efl_Canvas_Text_Cursor 
*cur1_obj, const Evas_Textblock_Cursor *cur2_obj)
 {
    Efl_Canvas_Text_Cursor_Data *cur = efl_data_scope_get(cur1_obj, 
EFL_CANVAS_TEXT_CURSOR_CLASS);
-   Efl_Canvas_Text_Data *o = efl_data_scope_get(cur->obj, MY_CLASS);
+   Efl_Canvas_Text_Data *o;
 
    if (!cur) return NULL;
 
+   o = efl_data_scope_get(cur->obj, MY_CLASS);
+
    return _efl_canvas_text_range_geometry_list_get(cur->obj, o, cur1_obj, 
cur2_obj);
 }
 

-- 


Reply via email to