Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check for NULL device on enumeration on Mac.

On Mac, hid_enumerate can crash if the device is unplugged during enumeration.

From: Richard Bateman (Taxilian) <taxilian@gmail.com>
  • Loading branch information...
commit 4f284dc2ec2706678126ff45dcc3ab81abad580e 2 parents 0bef94e + d94f682
@signal11 signal11 authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  mac/hid.c
View
3  mac/hid.c
@@ -320,6 +320,9 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
IOHIDDeviceRef dev = device_array[i];
+ if (!dev) {
+ continue;
+ }
dev_vid = get_vendor_id(dev);
dev_pid = get_product_id(dev);
Please sign in to comment.
Something went wrong with that request. Please try again.