From: Jakub Pawlowski Date: Tue, 13 Jun 2017 21:16:57 +0000 (-0700) Subject: Fix HID crashing on no descriptor X-Git-Tag: android-x86-8.1-r1~20^2~2^2^2~26 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a87ca9a392;p=android-x86%2Fsystem-bt.git Fix HID crashing on no descriptor Bug: 62461796 Test: compilation test Change-Id: Ic7b1fcc4b6f3c8680f1810679ed609f2691fa4aa --- diff --git a/bta/hh/bta_hh_le.cc b/bta/hh/bta_hh_le.cc index a30f8b818..da503ac5a 100644 --- a/bta/hh/bta_hh_le.cc +++ b/bta/hh/bta_hh_le.cc @@ -1443,6 +1443,11 @@ static void read_report_ref_desc_cb(uint16_t conn_id, tGATT_STATUS status, const tBTA_GATTC_DESCRIPTOR* p_desc = BTA_GATTC_GetDescriptor(conn_id, handle); + if (!p_desc) { + APPL_TRACE_ERROR("%s: error: descriptor is null!", __func__); + return; + } + tBTA_HH_LE_RPT* p_rpt; p_rpt = bta_hh_le_find_report_entry( p_dev_cb, p_desc->characteristic->service->handle, GATT_UUID_HID_REPORT,