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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tedd Ho-Jeong An <tedd.an@xxxxxxxxx>

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.25.1




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux