[vlc-devel] commit: Handle error (?) from config_GetInt (CID#180) ( 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:19 2008 +0300| [37b0e5a2c61efef752410de8b743c15c4b871c55] | committer: Rémi Denis-Courmont 

Handle error (?) from config_GetInt (CID#180)

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

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

diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c
index cadb5a7..0131015 100644
--- a/modules/misc/gnutls.c
+++ b/modules/misc/gnutls.c
@@ -969,7 +969,8 @@ gnutls_ServerSessionPrepare( tls_server_t *p_server )
 
     /* Session resumption support */
     i_val = config_GetInt (p_server, "gnutls-cache-timeout");
-    gnutls_db_set_cache_expiration (session, i_val);
+    if (i_val >= 0)
+        gnutls_db_set_cache_expiration (session, i_val);
     gnutls_db_set_retrieve_function( session, cb_fetch );
     gnutls_db_set_remove_function( session, cb_delete );
     gnutls_db_set_store_function( session, cb_store );
@@ -1069,6 +1070,8 @@ static int OpenServer (vlc_object_t *obj)
         return VLC_ENOMEM;
 
     p_sys->i_cache_size = config_GetInt (obj, "gnutls-cache-size");
+    if (p_sys->i_cache_size == -1) /* Duh, config subsystem exploded?! */
+        p_sys->i_cache_size = 0;
     p_sys->p_cache = calloc (p_sys->i_cache_size,
                              sizeof (struct saved_session_t));
     if (p_sys->p_cache == NULL)




More information about the vlc-devel mailing list