]> granicus.if.org Git - esp-idf/commitdiff
Component/bt: fix write char crash after disconnection
authorzhiweijian <zhiweijian@espressif.com>
Thu, 31 Jan 2019 03:28:55 +0000 (11:28 +0800)
committerbot <bot@espressif.com>
Thu, 31 Jan 2019 12:20:16 +0000 (12:20 +0000)
components/bt/bluedroid/stack/l2cap/l2c_api.c

index 5637cac6471212342efa1b79dfa93bfc52723abf..8e7781365d3a527d0917d26f2f182610969a470a 100644 (file)
@@ -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;
     }