[vlc-commits] keystore: reset credentials when they are not valid

Thomas Guillem git at videolan.org
Sun Jan 24 12:18:59 CET 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sun Jan 24 12:16:20 2016 +0100| [869567f732b0fda1f2d15478ab070b533e96770d] | committer: Thomas Guillem

keystore: reset credentials when they are not valid

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

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

diff --git a/src/misc/keystore.c b/src/misc/keystore.c
index 3d338a1..e44e605 100644
--- a/src/misc/keystore.c
+++ b/src/misc/keystore.c
@@ -156,8 +156,15 @@ find_closest_path(vlc_keystore_entry *p_entries, unsigned i_count,
 static bool
 is_credential_valid(vlc_credential *p_credential)
 {
-    return p_credential->psz_username && *p_credential->psz_username != '\0'
-        && p_credential->psz_password;
+    if (p_credential->psz_username && *p_credential->psz_username != '\0'
+     && p_credential->psz_password)
+        return true;
+    else
+    {
+        p_credential->psz_username = p_credential->psz_password = NULL;
+        return false;
+    }
+
 }
 
 /* Default port for each protocol */



More information about the vlc-commits mailing list