l2cap: fix uninitialized variable channel->local_mps in function l2cap_cbm_run_channel (#583)

Co-authored-by: xiaobye <skps96g313@gmail>
This commit is contained in:
xiaobye-ctf 2024-04-02 18:09:48 +08:00 committed by GitHub
parent 5b18e364d9
commit b8bf175511
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2055,6 +2055,7 @@ static bool l2cap_cbm_run_channel(l2cap_channel_t * channel) {
channel->credits_incoming = channel->new_credits_incoming;
channel->new_credits_incoming = 0;
mps = btstack_min(l2cap_max_le_mtu(), channel->local_mtu);
channel->local_mps = mps;
l2cap_send_le_signaling_packet(channel->con_handle, LE_CREDIT_BASED_CONNECTION_RESPONSE, channel->remote_sig_id, channel->local_cid, channel->local_mtu, mps, channel->credits_incoming, 0);
// notify client
l2cap_cbm_emit_channel_opened(channel, ERROR_CODE_SUCCESS);
@ -5843,4 +5844,4 @@ void l2cap_free_channels_fuzz(void){
}
}
}
#endif
#endif