From cb766777623ea13a9569c30b30f8a574f1b57d29 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 29 Mar 2011 14:34:14 +0000 Subject: [PATCH] Sanity check if the encrypted password isn't found in one source, to avoid a crash when invoking crypt() on it Monotone-Parent: cbeb8ed4edd6c44d422f9251785ee9bfad432e71 Monotone-Revision: 4a37382e84f4a00ccbbc0542ef0ae4a99a954cdd Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-03-29T14:34:14 Monotone-Branch: ca.inverse.sogo --- SoObjects/SOGo/SQLSource.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SoObjects/SOGo/SQLSource.m b/SoObjects/SOGo/SQLSource.m index 388fc4742..9e8d653e4 100644 --- a/SoObjects/SOGo/SQLSource.m +++ b/SoObjects/SOGo/SQLSource.m @@ -133,6 +133,9 @@ - (BOOL) _isPassword: (NSString *) plainPassword equalTo: (NSString *) encryptedPassword { + if (!plainPassword || !encryptedPassword) + return NO; + if ([_userPasswordAlgorithm caseInsensitiveCompare: @"none"] == NSOrderedSame) { return [plainPassword isEqualToString: encryptedPassword];