projects
/
platform
/
upstream
/
bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a6ccad
)
sixaxis: Fix crash caused by return of udev_device_get_property_value
author
Miao-chen Chou
<mcchou@chromium.org>
Wed, 16 Sep 2020 22:34:53 +0000
(15:34 -0700)
committer
Ayush Garg
<ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:32 +0000
(19:08 +0530)
This adds a NULL check before calling sscanf().
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
plugins/sixaxis.c
patch
|
blob
|
history
diff --git
a/plugins/sixaxis.c
b/plugins/sixaxis.c
index
3e14332
..
bed50d5
100755
(executable)
--- a/
plugins/sixaxis.c
+++ b/
plugins/sixaxis.c
@@
-410,7
+410,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);