From: Lutz Jänicke Date: Fri, 19 Oct 2007 07:36:34 +0000 (+0000) Subject: Prepare OpenSSL 0.9.8g: cherry pick X-Git-Tag: OpenSSL_0_9_8g~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8c447031adff74d8a910231fc06396bbbb331685;p=oweals%2Fopenssl.git Prepare OpenSSL 0.9.8g: cherry pick http://cvs.openssl.org/chngview?cn=16691 Don't try to lookup zero length session. PR: 1591 Submitted by: steve --- 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 {