ldandersen/scifihifi-iphone

SFHFKeychainUtils does not respect NSError** conventions

Closed this issue · 2 comments

Messages right from the clang static analyzer:

  1. Potential null dereference. According to coding standards in 'Creating and Returning NSError Objects' the parameter 'error' may be null.
  2. Method accepting NSError** should have a non-void return value to indicate whether or not an error occurred.

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.

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!