Merge branch 'bugfix/disconn_sdp_upon_wrong_data_v5.4' into 'release/v5.4'

fix(bt/bluedroid): disconnect SDP connection on receiving incorrect response (v5.4)

See merge request espressif/esp-idf!35143
This commit is contained in:
Wang Meng Yang 2024-11-26 15:00:07 +08:00
commit 76d90ba1ca

View File

@ -453,7 +453,7 @@ static void process_service_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply)
}
}
/* Now, ask for the next handle. Re-use the buffer we just got. */
/* Now, ask for the next handle. Reuse the buffer we just got. */
if (p_ccb->cur_handle < p_ccb->num_handles) {
BT_HDR *p_msg = (BT_HDR *) osi_malloc(SDP_DATA_BUF_SIZE);
UINT8 *p;
@ -669,6 +669,7 @@ static void process_service_search_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply)
if ((type >> 3) != DATA_ELE_SEQ_DESC_TYPE) {
SDP_TRACE_WARNING ("SDP - Wrong type: 0x%02x in attr_rsp\n", type);
sdp_disconnect (p_ccb, SDP_ILLEGAL_PARAMETER);
return;
}
p = sdpu_get_len_from_type (p, type, &seq_len);