From c9a090f1d1f6558e471ffb76cb625853374b87c9 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Sat, 23 Oct 2021 12:09:58 +0200 Subject: [PATCH] tests: bluetooth: tester: Fix memory corruption in reconfigured_cb Pass proper length when memsetting struct. Signed-off-by: Szymon Janc --- tests/bluetooth/tester/src/l2cap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bluetooth/tester/src/l2cap.c b/tests/bluetooth/tester/src/l2cap.c index 282439d6d9b6b..dd83854c31ee9 100644 --- a/tests/bluetooth/tester/src/l2cap.c +++ b/tests/bluetooth/tester/src/l2cap.c @@ -142,7 +142,7 @@ static void reconfigured_cb(struct bt_l2cap_chan *l2cap_chan) struct l2cap_reconfigured_ev ev; 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.mtu_remote = sys_cpu_to_le16(chan->le.tx.mtu);