Add the type check logic to avoid crash
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-event-receiver.c
index f3d50f3..563b8f6 100644 (file)
@@ -2890,6 +2890,11 @@ static  void __bt_manager_event_filter(GDBusConnection *connection,
                char *previous = NULL;
                char *current = NULL;
 
+               if (g_strcmp0(g_variant_get_type_string(parameters), "(sss)") != 0) {
+                       BT_ERR("Invalid variant format");
+                       return;
+               }
+
                if (__bt_get_owner_info(parameters, &name, &previous, &current)) {
                        BT_ERR("Fail to get the owner info");
                        return;