[vlc-devel] [PATCH 11/13] keystore: also store empty passwords

Thomas Guillem thomas at gllm.fr
Wed Feb 24 14:25:20 CET 2016


---
 src/misc/keystore.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/misc/keystore.c b/src/misc/keystore.c
index 855e026..a0ae3f5 100644
--- a/src/misc/keystore.c
+++ b/src/misc/keystore.c
@@ -552,13 +552,15 @@ vlc_credential_store(vlc_credential *p_credential, vlc_object_t *p_parent)
         return false;
     }
 
+    const uint8_t *p_password = (const uint8_t *)
+        (p_credential->psz_password != NULL ? p_credential->psz_password : "");
+
     if (!p_credential->p_keystore->b_secure)
         msg_Warn(p_credential->p_keystore, "The '%s' keystore is not secure, "
                  "stored password are not encrypted",
                  module_get_name(p_credential->p_keystore->p_module, false));
 
-    bool b_ret = vlc_keystore_store(p_credential->p_keystore, ppsz_values,
-                                    (const uint8_t *)p_credential->psz_password,
+    bool b_ret = vlc_keystore_store(p_keystore, ppsz_values, p_password,
                                     -1, psz_label) == VLC_SUCCESS;
     free(psz_label);
     free(psz_path);
-- 
2.7.0



More information about the vlc-devel mailing list