Skip to content

Commit 76d90ba

Browse files
committed
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
2 parents 3eab765 + f22b03c commit 76d90ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/bt/host/bluedroid/stack/sdp/sdp_discovery.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ static void process_service_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply)
453453
}
454454
}
455455

456-
/* Now, ask for the next handle. Re-use the buffer we just got. */
456+
/* Now, ask for the next handle. Reuse the buffer we just got. */
457457
if (p_ccb->cur_handle < p_ccb->num_handles) {
458458
BT_HDR *p_msg = (BT_HDR *) osi_malloc(SDP_DATA_BUF_SIZE);
459459
UINT8 *p;
@@ -669,6 +669,7 @@ static void process_service_search_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply)
669669

670670
if ((type >> 3) != DATA_ELE_SEQ_DESC_TYPE) {
671671
SDP_TRACE_WARNING ("SDP - Wrong type: 0x%02x in attr_rsp\n", type);
672+
sdp_disconnect (p_ccb, SDP_ILLEGAL_PARAMETER);
672673
return;
673674
}
674675
p = sdpu_get_len_from_type (p, type, &seq_len);

0 commit comments

Comments
 (0)