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
maint-2.0.2
Ludovic Marcotte 2011-03-29 14:34:14 +00:00
parent c74fe21484
commit cb76677762
1 changed files with 3 additions and 0 deletions

View File

@ -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];