Mesh:Fix Svace issue in bluetooth-frwk 53/241053/2
authoranuj.bhumiya <anuj.bhumiya@samsung.com>
Fri, 14 Aug 2020 06:34:45 +0000 (12:04 +0530)
committeranuj.bhumiya <anuj.bhumiya@samsung.com>
Fri, 14 Aug 2020 06:58:16 +0000 (12:28 +0530)
Change-Id: Iaa8072390d470a77bda655af99565f2eed774511
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
bt-api/bt-event-handler.c
bt-oal/bluez_hal/src/bt-hal-mesh-dbus-handler.c
bt-service/services/mesh/bt-service-mesh-cdb.c

index 79ce01a..b5dcd89 100644 (file)
@@ -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);
                }
index e1d12b0..b7ab8ab 100644 (file)
@@ -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) {
index 8137b65..22932d9 100644 (file)
@@ -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)