From: Jihoon Kim Date: Wed, 7 Sep 2016 07:49:01 +0000 (+0900) Subject: Fix dereference of NULL return issue X-Git-Tag: accepted/tizen/3.0/ivi/20161011.050552~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F76%2F87276%2F1;p=platform%2Fcore%2Fuifw%2Flibscl-ui.git Fix dereference of NULL return issue Return value of a function 'scl::CSCLKeyFocusHandler::get_instance' is dereferenced at sclresourcecache.cpp:990 without checking, but it is usually checked for this function (4/5). Change-Id: I8d2f0cf375262c0102a80aa1f86b4c12630cf2e7 Signed-off-by: Jihoon Kim --- diff --git a/scl/include/sclui.h b/scl/include/sclui.h index e9fe2ca..34f130c 100644 --- a/scl/include/sclui.h +++ b/scl/include/sclui.h @@ -452,4 +452,4 @@ private: //SCL_END_DECLS -#endif //__SCL_CORE_H__ +#endif //__SCL_UI_H__ diff --git a/scl/sclresourcecache.cpp b/scl/sclresourcecache.cpp index 727775c..39c6838 100644 --- a/scl/sclresourcecache.cpp +++ b/scl/sclresourcecache.cpp @@ -986,13 +986,17 @@ CSCLResourceCache::recompute_layout(sclwindow window) } CSCLKeyFocusHandler* focus_handler = CSCLKeyFocusHandler::get_instance(); - //reset navigation info - focus_handler->reset_key_navigation_info(window); + if (focus_handler) { + //reset navigation info + focus_handler->reset_key_navigation_info(window); + } for (loop = 0;loop < MAX_KEY;loop++) { SclLayoutKeyCoordinatePointer p = sclres_layout_key_coordinate_pointer_frame[layout][loop]; if (p && p->valid) { - //BUILDING KEY NAVIGATION INFO - focus_handler->update_key_navigation_info(window, loop, p); + if (focus_handler) { + //BUILDING KEY NAVIGATION INFO + focus_handler->update_key_navigation_info(window, loop, p); + } //BUILDING KEY NAVIGATION INFO COMPLETED (*pCurButtonContext)[loop].used = TRUE; if (popupindex != NOT_USED) { @@ -1046,8 +1050,11 @@ CSCLResourceCache::recompute_layout(sclwindow window) } } } - //finalize navigation info - focus_handler->finalize_key_navigation_info(window); + + if (focus_handler) { + //finalize navigation info + focus_handler->finalize_key_navigation_info(window); + } } }