diff options
author | Miao-chen Chou <mcchou@chromium.org> | 2020-09-16 15:34:53 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-09-16 23:17:20 -0700 |
commit | 3f2406997f30e06d910427c7b7c675d69e628c39 (patch) | |
tree | 82a4fa28353d997211f2352192fce5d35ad90cf9 /plugins | |
parent | 80fcbda6d5b906de64eaeb7eff7d8fc8e0ae8d67 (diff) | |
download | bluez-3f2406997f30e06d910427c7b7c675d69e628c39.tar.gz |
sixaxis: Fix crash caused by return of udev_device_get_property_value
This adds a NULL check before calling sscanf().
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sixaxis.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c index 939fed759..996f85dd6 100644 --- a/plugins/sixaxis.c +++ b/plugins/sixaxis.c @@ -411,7 +411,7 @@ get_pairing_type_for_device(struct udev_device *udevice, uint16_t *bus, hid_id = udev_device_get_property_value(hid_parent, "HID_ID"); - if (sscanf(hid_id, "%hx:%hx:%hx", bus, &vid, &pid) != 3) + if (!hid_id || sscanf(hid_id, "%hx:%hx:%hx", bus, &vid, &pid) != 3) return NULL; cp = get_pairing(vid, pid); |