Skip to content

Commit

Permalink
Avoid dereferencing a NULL pointer.
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhartling committed Feb 8, 2017
1 parent 0df0dca commit bb2272f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Incremental Store/EncryptedStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ - (BOOL)checkDatabaseStatusWithError:(NSError *__autoreleasing*)error {
*error = [NSError errorWithDomain:EncryptedStoreErrorDomain code:EncryptedStoreErrorIncorrectPasscode userInfo:userInfo];
}
}
return result && (*error == nil);
return result && (error == NULL || *error == nil);
}

- (BOOL)changeDatabasePassphrase:(NSString *)passphrase error:(NSError *__autoreleasing*)error {
Expand Down Expand Up @@ -962,7 +962,7 @@ - (BOOL)setDatabasePassphrase:(NSString *)passphrase error:(NSError *__autorelea
result = [self checkDatabaseStatusWithError:error];
}

return result && (*error == nil);
return result && (error == NULL || *error == nil);
}

- (BOOL)validateDatabasePassphrase:(NSString *)passphrase error:(NSError *__autoreleasing*)error {
Expand Down

0 comments on commit bb2272f

Please sign in to comment.