From 9a79c9b74a0453919ace188409cdb2396178e188 Mon Sep 17 00:00:00 2001 From: Tedd Ho-Jeong An Date: Fri, 12 Nov 2021 18:35:58 -0800 Subject: [PATCH] monitor: Fix uninitiailzed scalar variable This patch fixes the uninitiailzed varialble(CWE-457) reported by the Coverity scan. --- monitor/rfcomm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c index 41533b158..02300a8b5 100644 --- a/monitor/rfcomm.c +++ b/monitor/rfcomm.c @@ -437,6 +437,7 @@ void rfcomm_packet(const struct l2cap_frame *frame) if (frame->size < 4) goto fail; + memset(&hdr, 0, sizeof(hdr)); if (!l2cap_frame_get_u8(l2cap_frame, &hdr.address) || !l2cap_frame_get_u8(l2cap_frame, &hdr.control) || !l2cap_frame_get_u8(l2cap_frame, &length)) -- 2.47.3