From: zhiweijian Date: Thu, 31 Jan 2019 03:28:55 +0000 (+0800) Subject: Component/bt: fix write char crash after disconnection X-Git-Tag: v3.2-beta3~24^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=651a08f710001e66616fee3cafc85bf5e5696e2e;p=esp-idf Component/bt: fix write char crash after disconnection --- diff --git a/components/bt/bluedroid/stack/l2cap/l2c_api.c b/components/bt/bluedroid/stack/l2cap/l2c_api.c index 5637cac647..8e7781365d 100644 --- a/components/bt/bluedroid/stack/l2cap/l2c_api.c +++ b/components/bt/bluedroid/stack/l2cap/l2c_api.c @@ -1845,7 +1845,7 @@ BOOLEAN L2CA_CheckIsCongest(UINT16 fixed_cid, UINT16 handle) tL2C_LCB *p_lcb; p_lcb = l2cu_find_lcb_by_handle(handle); - if (p_lcb != NULL) { + if (p_lcb != NULL && p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL] != NULL) { return p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->cong_sent; }