Commit 37b0e5a2 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

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

parent 9de4d9dd
......@@ -969,6 +969,7 @@ gnutls_ServerSessionPrepare( tls_server_t *p_server )
/* Session resumption support */
i_val = config_GetInt (p_server, "gnutls-cache-timeout");
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 );
......@@ -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)
......
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