Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC: crash bugfix when trying to open device without a serial number #194

Merged
merged 1 commit into from
Oct 14, 2020

Conversation

kteynor
Copy link
Contributor

@kteynor kteynor commented Oct 2, 2020

Currently trying to call hid_open on a device that doesn't have a serial number will result in a crash in the call to wcscmp here. Check that it's not null before calling wcscmp.

@Youw Youw requested a review from a team October 2, 2020 15:27
Copy link
Member

@Youw Youw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks much!
The only thing that bothers me, is the fact that we threat this kind of issues (no serial number) differently on different platforms.
E.g.: on macOS serial_number may be an empty string "", but it never be a null pointer.
But the fix definitely doesn't make things any worse.

@Youw Youw added the Windows Related to Windows backend label Oct 2, 2020
@Youw Youw merged commit b1a2628 into libusb:master Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Windows Related to Windows backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants