Fixes in Tizen LE Client 37/197037/1 accepted/tizen/5.0/unified/20190110.060350 submit/tizen_5.0/20190109.044058 submit/tizen_5.0/20190109.044059
authoragrkush <kush.agrawal@samsung.com>
Tue, 8 Jan 2019 13:02:46 +0000 (18:32 +0530)
committerAmit KS <amit.s12@samsung.com>
Wed, 9 Jan 2019 04:33:07 +0000 (10:03 +0530)
1. Fix for crash when BT disconnect is called in between
   GATT connection procedure.

2. Setting NULL terminated manufacture data string.

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/389
(cherry picked from commit fadf16daaaf5f9980c5a76975ec1c07bc546c501)

Change-Id: Id356d1b4f5d5fd28f4c8c909b715ec325f4ff869
Signed-off-by: agrkush <kush.agrawal@samsung.com>
Signed-off-by: Amit KS <amit.s12@samsung.com>
resource/csdk/connectivity/src/bt_le_adapter/tizen/caleclient_vd.c

index 5fd6ad6..a79a307 100644 (file)
@@ -426,7 +426,7 @@ static bool CALEIsHaveServiceImpl(bt_adapter_le_device_scan_result_info_s *scanI
             for(int i=0;i<man_data_len;i++){
                 pos += sprintf(compare_man_data+pos, "%.2x", man_data[i]);
             }
-            compare_man_data[man_data_len]='\0';
+            compare_man_data[(man_data_len*2)+1]='\0';
             if (man_id == samsung_code && 0 == strncasecmp(compare_man_data, service_uuid, CUSTOM_UUID_LEN))
             {
                 OIC_LOG_V(DEBUG, TAG, "Manufacture Data[%s] Found in %s",
@@ -1387,6 +1387,7 @@ CAResult_t CALEGattDiscoverServices(const char *remoteAddress)
 
 error_exit:
     bt_gatt_client_destroy(serverInfo->clientHandle);
+    serverInfo->clientHandle = NULL;
     oc_mutex_unlock(g_LEServerListMutex);
     CALEGattDisConnect(remoteAddress);
     return CA_STATUS_FAILED;