From: DoHyun Pyun Date: Thu, 20 Aug 2020 23:45:33 +0000 (+0900) Subject: Fix the svace issue (DEREF_OF_NULL) X-Git-Tag: submit/tizen/20200825.072855~9^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a51b5737e8f042572c807980bfa806093cb95cf;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git Fix the svace issue (DEREF_OF_NULL) Change-Id: Id9d1f17f169c6e290a3f6d346adadd7733205f5b Signed-off-by: DoHyun Pyun --- diff --git a/bt-oal/bluez_hal/src/bt-hal-mesh-dbus-handler.c b/bt-oal/bluez_hal/src/bt-hal-mesh-dbus-handler.c index a548554f..0b9f8721 100644 --- a/bt-oal/bluez_hal/src/bt-hal-mesh-dbus-handler.c +++ b/bt-oal/bluez_hal/src/bt-hal-mesh-dbus-handler.c @@ -1468,7 +1468,7 @@ static struct l_dbus_message *__mesh_agent_prompt_static_request( uint8_t *net_uuid; const char *dbus_path; GSList *l; - meshcfg_app *app; + meshcfg_app *app = NULL; dbus_path = l_dbus_message_get_path(msg); net_uuid = __mesh_get_net_uuid_from_path(dbus_path, true, @@ -1478,7 +1478,13 @@ static struct l_dbus_message *__mesh_agent_prompt_static_request( l = g_slist_find_custom(mesh_apps, net_uuid, __mesh_compare_network_uuid); - app = l->data; + + if (l) { + app = l->data; + } else { + ERR("Mesh: app not found"); + } + memset(&ev, 0, sizeof(ev)); memcpy(ev.net_uuid, net_uuid, 16); @@ -1489,7 +1495,10 @@ static struct l_dbus_message *__mesh_agent_prompt_static_request( struct hal_ev_mesh_provision_finished ev; memset(&ev, 0, sizeof(ev)); - memcpy(ev.net_uuid, app->uuid, 16); + + if (app) + memcpy(ev.net_uuid, app->uuid, 16); + ev.status = BT_STATUS_FAIL; ev.reason = BT_HAL_MESH_PROV_ERR_INTERNAL; if (mesh_event_cb)