diff options
author | Ildar Kamaletdinov <i.kamaletdinov@omp.ru> | 2022-05-07 20:35:05 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-05-09 13:05:39 -0700 |
commit | 42e9b8db92d5d8725e9a1bfd93a5c6a257186776 (patch) | |
tree | 64283b55f7b3f0db7454d0e84a999436012287d0 /src/device.c | |
parent | e9ec1cf8715d72195a94d748777a19b8e2ba4db5 (diff) | |
download | bluez-42e9b8db92d5d8725e9a1bfd93a5c6a257186776.tar.gz |
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.
Diffstat (limited to 'src/device.c')
-rw-r--r-- | src/device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c index 6da5c380b..7114e1b3e 100644 --- a/src/device.c +++ b/src/device.c @@ -1568,6 +1568,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) @@ -1580,7 +1582,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); } |