From bb2272f208e5066de4df377c4a3e1bd981b07642 Mon Sep 17 00:00:00 2001 From: Patrick Fewell-Hartling Date: Wed, 8 Feb 2017 09:44:40 -0600 Subject: [PATCH] Avoid dereferencing a NULL pointer. --- Incremental Store/EncryptedStore.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Incremental Store/EncryptedStore.m b/Incremental Store/EncryptedStore.m index a5cec7f..09e6062 100755 --- a/Incremental Store/EncryptedStore.m +++ b/Incremental Store/EncryptedStore.m @@ -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 { @@ -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 {