[vlc-devel] [PATCH 1/6] keychain: accountName can be NULL
Thomas Guillem
thomas at gllm.fr
Thu Oct 31 15:38:07 CET 2019
---
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 66c48243324..70b6ee9def9 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]);
}
--
2.20.1
More information about the vlc-devel
mailing list