From b8bf1755110d8895952df06fbc69f4ab7788e64d Mon Sep 17 00:00:00 2001 From: xiaobye-ctf <60853091+xiaobye-ctf@users.noreply.github.com> Date: Tue, 2 Apr 2024 18:09:48 +0800 Subject: [PATCH] l2cap: fix uninitialized variable channel->local_mps in function l2cap_cbm_run_channel (#583) Co-authored-by: xiaobye --- src/l2cap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/l2cap.c b/src/l2cap.c index d77128d5d..231c6946d 100644 --- a/src/l2cap.c +++ b/src/l2cap.c @@ -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 \ No newline at end of file +#endif