From: Junghoon Park Date: Wed, 30 Nov 2016 02:34:36 +0000 (+0900) Subject: Handle null pointer exceptions X-Git-Tag: accepted/tizen/3.0/common/20161203.012120~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8be1a77f5e396c9183e41cfda477d8e889882177;p=platform%2Fcore%2Fappfw%2Faul-1.git Handle null pointer exceptions Change-Id: Iaba7023e0499bfdfaca667102f31b87848870efe Signed-off-by: Junghoon Park --- diff --git a/src/aul_rsm.c b/src/aul_rsm.c index e876e90..e48711d 100644 --- a/src/aul_rsm.c +++ b/src/aul_rsm.c @@ -267,25 +267,23 @@ static int __tbm_handler(const char *endpoint, aul_app_com_result_e e, bundle_get_str(envelope, "__AUL_RSP_RESOURCE_ID__", &id); bundle_get_byte(envelope, "__AUL_RSP_SURFACE_ID__", (void **)&res_id, &sz); bundle_get_byte(envelope, "__AUL_RSP_SURFACE_CREATOR_PID__", (void **)&pid, &sz); - if (id) { - surface = g_hash_table_lookup(__viewer_tbl, id); - if (!surface) { - _E("unknown surface"); - return 0; - } + + if (!id || !pid || !res_id) { + _E("bad tbm message received. missing arguments"); + return 0; } - if (pid != NULL) - surface->pid = (int)*pid; + surface = g_hash_table_lookup(__viewer_tbl, id); + if (!surface) { + _E("unknown surface"); + return 0; + } - if (res_id != NULL) { - surface->resource_id = *res_id; - surface->surface = tizen_remote_surface_manager_create_surface(__rsm, + surface->pid = (int)*pid; + surface->resource_id = *res_id; + surface->surface = tizen_remote_surface_manager_create_surface(__rsm, (uint32_t)surface->resource_id, __tbm); - __redirect_surface(surface); - } else { - _E("bad tbm message received. missing arguments"); - } + __redirect_surface(surface); _D("__tbm_handler %d, %d, %s", surface->pid, surface->resource_id, id); return 0;