diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-05-31 15:29:03 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-05-31 20:41:40 +0200 |
commit | 894c74738f620fa02d1532c2186c5060fbad7e05 (patch) | |
tree | 8cc9824bd4e651e84525081ed8017e9b5b92c5eb /lib | |
parent | 5e1e4dbf1e082181af9c0b55284c97a339368632 (diff) | |
download | curl-894c74738f620fa02d1532c2186c5060fbad7e05.tar.gz |
Curl_ssl_getsessionid: fail if no session cache exists
This function might get called for an easy handle for which the session
cache hasn't been setup. It now just returns a "miss" in that case.
Reported-by: Christoph M. Becker
Fixes #7148
Closes #7153
Diffstat (limited to 'lib')
-rw-r--r-- | lib/vtls/vtls.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 65f4f773d..1e6272b9f 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -407,8 +407,9 @@ bool Curl_ssl_getsessionid(struct Curl_easy *data, DEBUGASSERT(SSL_SET_OPTION(primary.sessionid)); - if(!SSL_SET_OPTION(primary.sessionid)) - /* session ID re-use is disabled */ + if(!SSL_SET_OPTION(primary.sessionid) || !data->state.session) + /* session ID re-use is disabled or the session cache has not been + setup */ return TRUE; /* Lock if shared */ |