Commit 28273d56 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by Derk-Jan Hartman

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

(cherry picked from commit 37b0e5a2)
parent 1d80eeb8
......@@ -966,7 +966,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 );
......@@ -1066,6 +1067,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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment