[BlueZ PATCH 3/3] client: 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.
---
 client/gatt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/client/gatt.c b/client/gatt.c
index ce13b3341..9c991c2ac 100644
--- a/client/gatt.c
+++ b/client/gatt.c
@@ -175,6 +175,7 @@ static void print_service_proxy(GDBusProxy *proxy, const char *description)
 
 	dbus_message_iter_get_basic(&iter, &primary);
 
+	memset(&service, 0, sizeof(service));
 	service.path = (char *) g_dbus_proxy_get_path(proxy);
 	service.uuid = (char *) uuid;
 	service.primary = primary;
@@ -257,6 +258,7 @@ static void print_characteristic(GDBusProxy *proxy, const char *description)
 
 	dbus_message_iter_get_basic(&iter, &uuid);
 
+	memset(&chrc, 0, sizeof(chrc));
 	chrc.path = (char *) g_dbus_proxy_get_path(proxy);
 	chrc.uuid = (char *) uuid;
 
@@ -350,6 +352,7 @@ static void print_descriptor(GDBusProxy *proxy, const char *description)
 
 	dbus_message_iter_get_basic(&iter, &uuid);
 
+	memset(&desc, 0, sizeof(desc));
 	desc.path = (char *) g_dbus_proxy_get_path(proxy);
 	desc.uuid = (char *) uuid;
 
-- 
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