[vlc-commits] keychain: accountName can be NULL

Thomas Guillem git at videolan.org
Thu Nov 14 15:24:00 CET 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Oct 29 16:10:04 2019 +0100| [d5275d408cc052f4e8b89eabeecada7c786fa4e6] | committer: Thomas Guillem

keychain: accountName can be NULL

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d5275d408cc052f4e8b89eabeecada7c786fa4e6
---

 modules/keystore/keychain.m | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/keystore/keychain.m b/modules/keystore/keychain.m
index 66c4824332..70b6ee9def 100644
--- a/modules/keystore/keychain.m
+++ b/modules/keystore/keychain.m
@@ -344,7 +344,8 @@ static unsigned int Find(vlc_keystore *p_keystore,
         NSMutableDictionary *passwordFetchQuery = [baseLookupQuery mutableCopy];
         [passwordFetchQuery setObject:(__bridge id)kCFBooleanTrue forKey:(__bridge id)kSecReturnData];
         [passwordFetchQuery setObject:(__bridge id)kSecMatchLimitOne forKey:(__bridge id)kSecMatchLimit];
-        [passwordFetchQuery setObject:accountName forKey:(__bridge id)kSecAttrAccount];
+        if (accountName)
+            [passwordFetchQuery setObject:accountName forKey:(__bridge id)kSecAttrAccount];
 
         CFTypeRef secretResult = NULL;
         status = SecItemCopyMatching((__bridge CFDictionaryRef)passwordFetchQuery, &secretResult);
@@ -354,7 +355,7 @@ static unsigned int Find(vlc_keystore *p_keystore,
             return 0;
         }
 
-        if (!p_entry->ppsz_values[KEY_USER]) {
+        if (!p_entry->ppsz_values[KEY_USER] && accountName) {
             msg_Dbg(p_keystore, "using account name from the keychain for login");
             p_entry->ppsz_values[KEY_USER] = strdup([accountName UTF8String]);
         }



More information about the vlc-commits mailing list