Fixed svace issues 48/223648/2 submit/tizen/20200203.092811 submit/tizen/20200210.055947
authorAbhimanyu Swami <abhimanyu1.s@samsung.com>
Fri, 31 Jan 2020 11:57:12 +0000 (17:27 +0530)
committerAbhimanyu Swami <abhimanyu1.s@samsung.com>
Fri, 31 Jan 2020 12:15:35 +0000 (17:45 +0530)
Change-Id: I229479207f3191cbe8d9fff753979b6721a6265b
Signed-off-by: Abhimanyu Swami <abhimanyu1.s@samsung.com>
geofence-server/src/geofence_server.c

index 5cb8ea8..b0268ba 100644 (file)
@@ -232,7 +232,7 @@ void bt_le_scan_result_display_cb(int result, bt_adapter_le_device_scan_result_i
                                if (bt_info != NULL) {
                                        ret = bt_adapter_get_bonded_device_info(bt_info->bssid, &bt_device_info);
                                        if (ret == BT_ERROR_NONE) {
                                if (bt_info != NULL) {
                                        ret = bt_adapter_get_bonded_device_info(bt_info->bssid, &bt_device_info);
                                        if (ret == BT_ERROR_NONE) {
-                                               if (bt_device_info->is_connected == false)
+                                               if (bt_device_info != NULL && bt_device_info->is_connected == false)
                                                        ble_proximity_mode = BLE_INFO_READ;
                                        } else if (ret == BT_ERROR_REMOTE_DEVICE_NOT_BONDED) {
                                                ble_proximity_mode = BLE_INFO_READ; /*Its not bonded*/
                                                        ble_proximity_mode = BLE_INFO_READ;
                                        } else if (ret == BT_ERROR_REMOTE_DEVICE_NOT_BONDED) {
                                                ble_proximity_mode = BLE_INFO_READ; /*Its not bonded*/
@@ -2223,7 +2223,10 @@ static void dbus_start_geofence_cb(gint fence_id, const gchar *app_id, gpointer
                                if (rv != WIFI_MANAGER_ERROR_NONE) {
                                        LOGI_GEOFENCE("Fail to get the bssid: [%s]\n", __convert_wifi_error_to_string(rv));
                                } else {
                                if (rv != WIFI_MANAGER_ERROR_NONE) {
                                        LOGI_GEOFENCE("Fail to get the bssid: [%s]\n", __convert_wifi_error_to_string(rv));
                                } else {
-                                       bssidlen = strlen(ap_bssid);
+                                       if(ap_bssid != NULL)
+                                               bssidlen = strlen(ap_bssid);
+                                       else
+                                               bssidlen = 0;
                                        LOGI_GEOFENCE("Connected AP: %s, %d\n", ap_bssid, bssidlen);
                                        if (g_strcmp0(wifi_info->bssid, ap_bssid) == 0) {
                                                status_to_be_emitted = GEOFENCE_FENCE_STATE_IN;
                                        LOGI_GEOFENCE("Connected AP: %s, %d\n", ap_bssid, bssidlen);
                                        if (g_strcmp0(wifi_info->bssid, ap_bssid) == 0) {
                                                status_to_be_emitted = GEOFENCE_FENCE_STATE_IN;