We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4730 - [PATCH] hidapi: Zero out new hid_device_info structs
Summary: [PATCH] hidapi: Zero out new hid_device_info structs
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-23 19:43 UTC by Andrew Eikum
Modified: 2019-07-24 07:55 UTC (History)
1 user (show)

See Also:


Attachments
[PATCH] hidapi: Zero out new hid_device_info structs (761 bytes, patch)
2019-07-23 19:43 UTC, Andrew Eikum
Details | Diff
[PATCH] hidapi: Zero out new hid_device_info structs on mac, too (753 bytes, patch)
2019-07-23 19:46 UTC, Andrew Eikum
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Eikum 2019-07-23 19:43:43 UTC
Created attachment 3892 [details]
[PATCH] hidapi: Zero out new hid_device_info structs

In particular this fixes a garbage usage_page value from the hidraw hidapi-backend being used, which meant the hidapi joystick-backend wouldn't match drivers for a device.
Comment 1 Andrew Eikum 2019-07-23 19:46:28 UTC
Created attachment 3893 [details]
[PATCH] hidapi: Zero out new hid_device_info structs on mac, too

It occurred to me to check the other backends, too. This patch applies it to the macOS backend, although they already set usage_page, so perhaps it fixes nothing. The libusb and Windows backends already use calloc.
Comment 2 Ozkan Sezer 2019-07-24 07:55:26 UTC
Applied these two patches as obvious.
https://hg.libsdl.org/SDL/rev/bc90ce38f1e2