From f85bed24b2a050d2b525b03aa329a9041f640229 Mon Sep 17 00:00:00 2001 From: Ildar Kamaletdinov Date: Sat, 7 May 2022 20:35:05 +0300 Subject: [PATCH] device: Fix uninitialized value usage Definitely `dbus_bool_t b;` must be initialized before comparing it with current value. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Signed-off-by: Manika Shrivastava Signed-off-by: Ayush Garg --- src/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index ead0e99..d0c4254 100644 --- a/src/device.c +++ b/src/device.c @@ -2091,6 +2091,8 @@ static void dev_property_set_wake_allowed(const GDBusPropertyTable *property, return; } + dbus_message_iter_get_basic(value, &b); + /* Emit busy or success depending on current value. */ if (b == device->pending_wake_allowed) { if (device->wake_allowed == device->pending_wake_allowed) @@ -2103,7 +2105,6 @@ static void dev_property_set_wake_allowed(const GDBusPropertyTable *property, return; } - dbus_message_iter_get_basic(value, &b); device_set_wake_override(device, b); device_set_wake_allowed(device, b, id); } -- 2.7.4