From: Rose Date: Sat, 14 Sep 2024 19:41:02 +0000 (-0400) Subject: Return early if kvPairs is NULL X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1050%2Fhead;p=thirdparty%2Fcups.git Return early if kvPairs is NULL --- 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++)