vtls: exit addsessionid if no cache is inited
Follow-up to b249592d29
Avoids NULL pointer derefs.
Closes #7165
This commit is contained in:
Родитель
f1cd5004b0
Коммит
c7b93a76ea
|
@ -499,8 +499,8 @@ CURLcode Curl_ssl_addsessionid(struct Curl_easy *data,
|
|||
int sockindex)
|
||||
{
|
||||
size_t i;
|
||||
struct Curl_ssl_session *store = &data->state.session[0];
|
||||
long oldest_age = data->state.session[0].age; /* zero if unused */
|
||||
struct Curl_ssl_session *store;
|
||||
long oldest_age;
|
||||
char *clone_host;
|
||||
char *clone_conn_to_host;
|
||||
int conn_to_port;
|
||||
|
@ -516,6 +516,11 @@ CURLcode Curl_ssl_addsessionid(struct Curl_easy *data,
|
|||
const char *hostname = conn->host.name;
|
||||
#endif
|
||||
(void)sockindex;
|
||||
if(!data->state.session)
|
||||
return CURLE_OK;
|
||||
|
||||
store = &data->state.session[0];
|
||||
oldest_age = data->state.session[0].age; /* zero if unused */
|
||||
DEBUGASSERT(SSL_SET_OPTION(primary.sessionid));
|
||||
|
||||
clone_host = strdup(hostname);
|
||||
|
|
Загрузка…
Ссылка в новой задаче