Skip to content

Commit

Permalink
macOS: fix crash when IOHIDDevice property is not a string (#573)
Browse files Browse the repository at this point in the history
- fixed crash on macOS when AirPods are connected (reported to happen with some AirPods on some macOS version);
  • Loading branch information
slouken authored Jun 7, 2023
1 parent fea2357 commit c6c4dd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mac/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ static int get_string_property(IOHIDDeviceRef device, CFStringRef prop, wchar_t

buf[0] = 0;

if (str) {
if (str && CFGetTypeID(str) == CFStringGetTypeID()) {
CFIndex str_len = CFStringGetLength(str);
CFRange range;
CFIndex used_buf_len;
Expand Down

0 comments on commit c6c4dd0

Please sign in to comment.