From 1520cda1bda6570e0bbcdb99459fcd719b1f3eee Mon Sep 17 00:00:00 2001 From: Zorg Date: Sun, 26 Apr 2026 14:50:32 -0700 Subject: [PATCH] Guard against NULL CFRelease() on failure condition in fallback path (#2867) This was caught by analysis for XPC validation path. This is very unlikely to be hit practically. --- Autoupdate/SUCodeSigningVerifier.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Autoupdate/SUCodeSigningVerifier.m b/Autoupdate/SUCodeSigningVerifier.m index 4ec5352d..777dc353 100644 --- a/Autoupdate/SUCodeSigningVerifier.m +++ b/Autoupdate/SUCodeSigningVerifier.m @@ -471,7 +471,9 @@ finally: SecCodeRef code = NULL; OSStatus result = SecCodeCopyGuestWithAttributes(NULL, (__bridge CFDictionaryRef _Nullable)(attributes), kSecCSDefaultFlags, &code); if (result != errSecSuccess) { - CFRelease(code); + if (code != NULL) { + CFRelease(code); + } if (error != NULL) { *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInsufficientSigningError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"The client connection could not be validated because SecCodeCopyGuestWithAttributes() failed with error %d", result] }];