Don't lookup zero length session ID.

PR: 1591
This commit is contained in:
Dr. Stephen Henson 2007-10-17 17:31:57 +00:00
parent 4017e8706c
commit 3d3bf9c730

View File

@ -435,10 +435,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->session_ctx->session_cache_mode & SSL_SESS_CACHE_NO_INTERNAL_LOOKUP))
#endif
{