Skip to content

Bluetooth: Classic: SDP: correct partial response seq length #93314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions subsys/bluetooth/host/classic/sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,11 @@ static uint8_t select_attrs(struct bt_sdp_attribute *attr, uint8_t att_idx,
(space < seq_size + sad->cont_state_size))) {
/* Packet exhausted */
sad->state->pkt_full = true;

/* This case mean packet is exhausted, state stays at
* the previous attr, we should break the loop.
*/
break;
}
}

Expand Down Expand Up @@ -1322,6 +1327,18 @@ static uint16_t sdp_svc_search_att_req(struct bt_sdp *sdp, struct net_buf *buf,
}

rsp_buf_cpy = NULL;
/*
* If current service is the same as the next service,
* then we should continue from the last attribute.
*/
if (state.current_svc == next_svc) {
next_att = state.last_att;
}

/* continue from the last attribute, just dry run. */
att_list_len += create_attr_list(sdp, record, filter, num_filters,
max_att_len, SDP_SSA_CONT_STATE_SIZE + 1,
next_att, &state, rsp_buf_cpy);
}

next_att = 0U;
Expand Down