[vlc-commits] keystore: fix use-after-free

Thomas Guillem git at videolan.org
Fri Jul 8 16:19:34 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jul  8 16:17:11 2016 +0200| [23536a28c22c1c12a2e1f52031dea8bea7b94f1a] | committer: Thomas Guillem

keystore: fix use-after-free

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

 src/misc/keystore.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/misc/keystore.c b/src/misc/keystore.c
index a05907d..3f9077c 100644
--- a/src/misc/keystore.c
+++ b/src/misc/keystore.c
@@ -309,8 +309,11 @@ credential_find_keystore(vlc_credential *p_credential, vlc_keystore *p_keystore)
      * p_credential->psz_username (default username) can be a pointer to an
      * entry */
     if (p_credential->i_entries_count > 0)
+    {
         vlc_keystore_release_entries(p_credential->p_entries,
                                      p_credential->i_entries_count);
+        p_credential->psz_username = NULL;
+    }
     p_credential->p_entries = p_entries;
     p_credential->i_entries_count = i_entries_count;
 



More information about the vlc-commits mailing list