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

Safety check to prevent crash on macOS when IOHIDManagerCopyDevices() returns NULL #359

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Safety check to prevent crash on macOS when IOHIDManagerCopyDevices() returns NULL #359

wants to merge 1 commit into from

Conversation

Timac
Copy link

@Timac Timac commented Sep 25, 2017

I have seen several crashes on macOS 10.12.6 caused by the fact that IOHIDManagerCopyDevices() returned NULL. Calling CFSetGetCount() on a NULL CFSetRef causes a crash. The fix consists of checking if the CFSetRef is not NULL before using it. Here is a backtrace of a crash:

0x00007fffd04a5118 CFSetGetCount + 24
0x000000010c15147f hid_enumerate (hid.c:427)
0x000000010c151acc hid_open (hid.c:529)

…IOHIDManagerCopyDevices() returned NULL. Calling CFSetGetCount() on a NULL CFSetRef causes a crash. The fix consists of checking if the CFSetRef is not NULL before using it. Here is a backtrace of a crash:

0x00007fffd04a5118 CFSetGetCount + 24
0x000000010c15147f hid_enumerate (hid.c:427)
0x000000010c151acc hid_open (hid.c:529)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant