From ebf254341fc2dcc14e0d9fa1778325ff3ead17be Mon Sep 17 00:00:00 2001 From: "anuj.bhumiya" Date: Fri, 14 Aug 2020 12:04:45 +0530 Subject: [PATCH] Mesh:Fix Svace issue in bluetooth-frwk Change-Id: Iaa8072390d470a77bda655af99565f2eed774511 Signed-off-by: anuj.bhumiya --- bt-api/bt-event-handler.c | 2 +- bt-oal/bluez_hal/src/bt-hal-mesh-dbus-handler.c | 6 ++++++ bt-service/services/mesh/bt-service-mesh-cdb.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bt-api/bt-event-handler.c b/bt-api/bt-event-handler.c index 79ce01a..b5dcd89 100644 --- a/bt-api/bt-event-handler.c +++ b/bt-api/bt-event-handler.c @@ -656,7 +656,7 @@ static void __bt_mesh_event_filter(GDBusConnection *connection, for (i = 0; i < total; i++) g_free(info.sub_list[i]); - if (info.appkey_list) { + if (info.sub_list) { g_free(info.sub_list); g_variant_iter_free(iter); } 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 e1d12b0..b7ab8ab 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 @@ -1419,6 +1419,10 @@ static struct l_dbus_message *__mesh_agent_prompt_numeric_request( l = g_slist_find_custom(mesh_apps, net_uuid, __mesh_compare_network_uuid); + if (!l) { + g_free(net_uuid); + return NULL; + } app = l->data; memset(&ev, 0, sizeof(ev)); @@ -1782,6 +1786,8 @@ void __bt_mesh_enable_scanning_timer(uint8_t *net_uuid, uint16_t secs) meshcfg_app *app; l = g_slist_find_custom(mesh_apps, net_uuid, __mesh_compare_network_uuid); + if (!l) + return; app = l->data; if (app->scan_timer_id > 0) { diff --git a/bt-service/services/mesh/bt-service-mesh-cdb.c b/bt-service/services/mesh/bt-service-mesh-cdb.c index 8137b65..22932d9 100644 --- a/bt-service/services/mesh/bt-service-mesh-cdb.c +++ b/bt-service/services/mesh/bt-service-mesh-cdb.c @@ -488,6 +488,8 @@ static bool __mesh_jarray_group_delete(json_object *jarray, uint16_t group_addr) continue; str = json_object_get_string(jval); + if (!str) + continue; memcpy(buf, str + 6, 5); BT_INFO("Mesh: JSON Group string:[%s]", buf); if (sscanf(buf, "%04hx", &addr) != 1) -- 2.7.4