From 9c7b7793cf072e6cf662c1b9366b15aa70751515 Mon Sep 17 00:00:00 2001 From: Rose Date: Sat, 14 Sep 2024 15:41:02 -0400 Subject: [PATCH] Return early if kvPairs is NULL --- backend/usb-darwin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c index 023e8a65a9..5040c604e4 100644 --- a/backend/usb-darwin.c +++ b/backend/usb-darwin.c @@ -1894,6 +1894,8 @@ static CFStringRef copy_value_for_key(CFStringRef deviceID, return NULL; kvPairs = CFStringCreateArrayBySeparatingStrings(kCFAllocatorDefault, deviceID, CFSTR(";")); + if (!kvPairs) + return NULL; max = CFArrayGetCount(kvPairs); for (CFIndex idx = 0; idx < max; idx++)