diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2007-10-17 17:30:15 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2007-10-17 17:30:15 +0000 |
commit | 33ffe2a7f7d0ef64c3012111188d5d0ee587dd59 (patch) | |
tree | 6e5629f65edac412def592116e20a3ac68b376a5 /ssl | |
parent | 7c717aafc6f65f855826a79c47398aa1e705e23e (diff) |
Don't try to lookup zero length session.
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/ssl_sess.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index d30a24f2fe..ee88be2b88 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -320,10 +320,12 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, fatal = 1; goto err; } - else if (r == 0) + else if (r == 0 || (!ret && !len)) goto err; else if (!ret && !(s->session_ctx->session_cache_mode & SSL_SESS_CACHE_NO_INTERNAL_LOOKUP)) #else + if (len == 0) + goto err; if (!(s->ctx->session_cache_mode & SSL_SESS_CACHE_NO_INTERNAL_LOOKUP)) #endif { |