SFHFKeychainUtils does not respect NSError** conventions
Closed this issue · 2 comments
0xced commented
Messages right from the clang static analyzer:
- Potential null dereference. According to coding standards in 'Creating and Returning NSError Objects' the parameter 'error' may be null.
- Method accepting NSError** should have a non-void return value to indicate whether or not an error occurred.
baron commented
clang always gives me errors on SFHFKeychain.
Please check the following and merge or incorporate into master as needed:
http://github.com/yllan/scifihifi-iphone/commits/master
Most forks of your project are to fix warnings raised by the compiler:
http://github.com/ldandersen/scifihifi-iphone/network
Don't mean any offense and deeply grateful for this utility. Cheers.
theory commented
Any chance of baron's fix(es) getting merged? Just switched to Xcode 4.0 an am getting these errors. Seems we can work around it with just this change:
--- a/security/SFHFKeychainUtils.m
+++ b/security/SFHFKeychainUtils.m
@@ -110,7 +110,7 @@ static NSString *SFHFKeychainUtilsErrorDomain = @"SFHFKeychainUtilsEr
return;
}
- *error = nil;
+ if (error) *error = nil;
if (item) {
status = SecKeychainItemModifyAttributesAndData(item,
Thanks!