From d84a0c51e0fe467a5aa7446e4183ea99c3ae3c94 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 9 Jan 2002 09:38:37 +0000 Subject: [PATCH] Cris Bailiff found out that when the SSL session cache was filled, libcurl would crash. This corrects the problem. --- lib/ssluse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ssluse.c b/lib/ssluse.c index 47ae497..21f27cd 100644 --- a/lib/ssluse.c +++ b/lib/ssluse.c @@ -552,9 +552,9 @@ int Curl_SSL_Close_All(struct SessionHandle *data) static int Store_SSL_Session(struct connectdata *conn) { SSL_SESSION *ssl_sessionid; - struct curl_ssl_session *store; int i; struct SessionHandle *data=conn->data; /* the mother of all structs */ + struct curl_ssl_session *store = &data->state.session[0]; int oldest_age=data->state.session[0].age; /* zero if unused */ /* ask OpenSSL, say please */ @@ -568,7 +568,8 @@ static int Store_SSL_Session(struct connectdata *conn) the oldest if necessary) */ /* find an empty slot for us, or find the oldest */ - for(i=0; (iset.ssl.numsessions) && data->state.session[i].sessionid; i++) { + for(i=1; (iset.ssl.numsessions) && + data->state.session[i].sessionid; i++) { if(data->state.session[i].age < oldest_age) { oldest_age = data->state.session[i].age; store = &data->state.session[i]; -- 2.7.4