From d6f67ac711930f8789599f5c8f09746025ebbbba Mon Sep 17 00:00:00 2001 From: Daehyeon Jung Date: Fri, 17 Jun 2016 14:22:16 +0900 Subject: [PATCH] fix dereference wrong ptr and uninitialized val Change-Id: Ib47aaf212970c533912ac2cd08f7a7324ce5897f --- src/widget_app.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/widget_app.c b/src/widget_app.c index c8e3764..ba14ac9 100755 --- a/src/widget_app.c +++ b/src/widget_app.c @@ -326,7 +326,7 @@ static int __instance_resize(widget_class_h handle, const char *id, int w, int h static int __instance_update(widget_class_h handle, const char *id, bundle *b) { widget_context_s *wc = __find_context_by_id(id); - int ret; + int ret = 0; int force; char *force_str = NULL; @@ -445,6 +445,11 @@ static void __resize_window(char *id, bundle *b) int w; int h; + if (!wc) { + _E("can not find instance: %s", id); + return; + } + bundle_get_str(b, WIDGET_K_WIDTH, &w_str); bundle_get_str(b, WIDGET_K_HEIGHT, &h_str); -- 2.7.4