diff mbox series

[BlueZ,2/3] monitor: Fix uninitiailzed scalar variable

Message ID 20211113023559.212793-2-hj.tedd.an@gmail.com
State New
Headers show
Series None | expand

Commit Message

Tedd Ho-Jeong An Nov. 13, 2021, 2:35 a.m. UTC
From: Tedd Ho-Jeong An <tedd.an@intel.com>

This patch fixes the uninitiailzed varialble(CWE-457) reported by
the Coverity scan.
---
 monitor/rfcomm.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

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))