Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed potential crasher in code signing in the case that the host app…

…lication is not code signed.
  • Loading branch information...
commit 3d8be2d2dacea68e1a68f13d12ddfc78b3a0c4b4 1 parent a59e8ff
@andymatuschak andymatuschak authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 SUCodeSigningVerifier.m
View
6 SUCodeSigningVerifier.m
@@ -26,10 +26,11 @@ + (BOOL)codeSignatureIsValidAtPath:(NSString *)destinationPath error:(NSError **
// This API didn't exist prior to 10.6.
if (SecCodeCopySelf == NULL) return NO;
- SecRequirementRef requirement = NULL;
OSStatus result;
-
+ SecRequirementRef requirement = NULL;
+ SecStaticCodeRef staticCode = NULL;
SecCodeRef hostCode = NULL;
+
result = SecCodeCopySelf(kSecCSDefaultFlags, &hostCode);
if (result != 0) {
SULog(@"Failed to copy host code %d", result);
@@ -42,7 +43,6 @@ + (BOOL)codeSignatureIsValidAtPath:(NSString *)destinationPath error:(NSError **
goto finally;
}
- SecStaticCodeRef staticCode = NULL;
NSBundle *newBundle = [NSBundle bundleWithPath:destinationPath];
if (!newBundle) {
SULog(@"Failed to load NSBundle for update");
Please sign in to comment.
Something went wrong with that request. Please try again.