bt-api/bt-event-handler: Fix array index issue 56/31756/1
authorGowtham Anandha Babu <gowtham.ab@samsung.com>
Tue, 9 Dec 2014 12:39:43 +0000 (18:09 +0530)
committerGowtham Anandha Babu <gowtham.ab@samsung.com>
Tue, 9 Dec 2014 12:39:43 +0000 (18:09 +0530)
Array index 'i' is used before limits check.

Change-Id: I008cde77339b4d68aa11bcecccf15543906234e5

bt-api/bt-event-handler.c

index 9cbea92..3d87fde 100644 (file)
@@ -148,7 +148,7 @@ static void __bt_get_uuid_info(bluetooth_device_info_t *dev_info,
 
        dev_info->service_index = uuid_count;
 
-       for (i = 0; uuids[i] != NULL && i < uuid_count; i++) {
+       for (i = 0; i < uuid_count && uuids[i] != NULL; i++) {
                g_strlcpy(dev_info->uuids[i], uuids[i], BLUETOOTH_UUID_STRING_MAX);
 
                parts = g_strsplit(uuids[i], "-", -1);