[vlc-devel] commit: Fix NULL dereference (CID#167) ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Oct 5 15:51:49 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Oct  5 16:51:00 2008 +0300| [9de4d9dd6bf7f84a89ebe0bc26815bc8daf75973] | committer: Rémi Denis-Courmont 

Fix NULL dereference (CID#167)

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

 modules/misc/gnutls.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c
index c208b2c..cadb5a7 100644
--- a/modules/misc/gnutls.c
+++ b/modules/misc/gnutls.c
@@ -723,10 +723,11 @@ static int OpenClient (vlc_object_t *obj)
     char *servername = var_GetNonEmptyString (p_session, "tls-server-name");
     if (servername == NULL )
         msg_Err (p_session, "server name missing for TLS session");
+    else
+        gnutls_server_name_set (p_sys->session.session, GNUTLS_NAME_DNS,
+                                servername, strlen (servername));
 
     p_sys->session.psz_hostname = servername;
-    gnutls_server_name_set (p_sys->session.session, GNUTLS_NAME_DNS,
-                            servername, strlen (servername));
 
     return VLC_SUCCESS;
 




More information about the vlc-devel mailing list