Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

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

Merged
merged 1 commit into from
Jul 10, 2018

Conversation

debris
Copy link

@debris debris commented Jul 10, 2018

…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)
@andresilva andresilva merged commit 743b75d into master Jul 10, 2018
@debris debris deleted the SafetyCheckCFSetGetCount branch July 10, 2018 20:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants