From 16a19010c1b3f36f8a1350891d272279fe972aaa Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 12 Apr 2018 11:58:49 -0700 Subject: [PATCH] DO NOT MERGE Initialize local variable in gatts_process_read_by_type_req Bug: 73125709 Test: manual Change-Id: I8b3346f605e0820385ea5ed7401bbee664fd15aa (cherry picked from commit 0e34139d7fa338df6c99aaba13eb839a3dbc2548) --- stack/gatt/gatt_sr.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stack/gatt/gatt_sr.cc b/stack/gatt/gatt_sr.cc index 06c9c5205..f9e8f537f 100644 --- a/stack/gatt/gatt_sr.cc +++ b/stack/gatt/gatt_sr.cc @@ -788,7 +788,8 @@ static void gatts_process_mtu_req(tGATT_TCB& tcb, uint16_t len, void gatts_process_read_by_type_req(tGATT_TCB& tcb, uint8_t op_code, uint16_t len, uint8_t* p_data) { tBT_UUID uuid; - uint16_t s_hdl, e_hdl, err_hdl = 0; + uint16_t s_hdl = 0, e_hdl = 0, err_hdl = 0; + if (len < 4) android_errorWriteLog(0x534e4554, "73125709"); tGATT_STATUS reason = gatts_validate_packet_format(op_code, len, p_data, &uuid, s_hdl, e_hdl); -- 2.11.0