Fix: Crash occured when HID deactived 79/113479/1
authorInjun Yang <injun.yang@samsung.com>
Wed, 8 Feb 2017 01:14:43 +0000 (10:14 +0900)
committerInjun Yang <injun.yang@samsung.com>
Wed, 8 Feb 2017 01:42:14 +0000 (10:42 +0900)
[Model] All
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] Internal
[Occurence Version] N/A

[Problem] When HID deactived, crash occured
[Cause & Measure] Access the invalid memory
[Checking Method] Check the validation of variable.

[Team] Basic Connection
[Developer] Injun Yang
[Solution company] Samsung
[Change Type] Specification change

Change-Id: Ifd88e39c98cccb29f3b4eaad23b1fa53b669da47
Signed-off-by: Injun Yang <injun.yang@samsung.com>
src/device.c

index 73ae618..1996ea0 100644 (file)
@@ -5870,6 +5870,9 @@ void device_remove_profile(gpointer a, gpointer b)
                if (g_strcmp0(profile->local_uuid , HID_DEVICE_UUID) == 0) {
                        l = find_service_with_uuid(device->services,
                                        HID_DEVICE_UUID);
+                       if (l == NULL)
+                               return;
+
                        service = l->data;
 
                        if (btd_service_get_state(service) ==