hidraw: fix number of bytes to copy from uevent in parse_uevent_info #497
No reviewers
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi!497
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-memcpy-in-parse_uevent_info"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Commit
5c9f147a07(#432) replaced a call to strdup with an explicit memcpy to a buffer on the stack.However, it incorrectly used the buffer size, instead of the clamped uevent length, as the argument to memcpy, resulting in reads past the end of uevent:
Fix this by using uevent_len as the argument to memcpy.
Calling strndupa was considered but abandoned, as it is not standard.
Fixes:
5c9f147a07(#432)Fixes:
4779d63d87That is a good catch, thanks.
Do you mind applying the same fix in
parse_hid_vid_pid_from_ueventfunction?Sure! Done.
This is no-workaround and high-risk bug introdecud in the latest release.
I'll release 0.13.1 as a hotfix for this ASAP.