tests: bluetooth: tester: Fix memory corruption in reconfigured_cb

Pass proper length when memsetting struct.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This commit is contained in:
Szymon Janc 2021-10-23 12:09:58 +02:00 committed by Johan Hedberg
commit 349f9dfc71

View file

@ -142,7 +142,7 @@ static void reconfigured_cb(struct bt_l2cap_chan *l2cap_chan)
struct l2cap_reconfigured_ev ev; struct l2cap_reconfigured_ev ev;
struct channel *chan = CONTAINER_OF(l2cap_chan, struct channel, le); struct channel *chan = CONTAINER_OF(l2cap_chan, struct channel, le);
(void)memset(&ev, 0, sizeof(struct l2cap_disconnected_ev)); (void)memset(&ev, 0, sizeof(ev));
ev.chan_id = chan->chan_id; ev.chan_id = chan->chan_id;
ev.mtu_remote = sys_cpu_to_le16(chan->le.tx.mtu); ev.mtu_remote = sys_cpu_to_le16(chan->le.tx.mtu);