From: David Ramos Date: Sun, 1 Jun 2014 13:23:51 +0000 (+0100) Subject: Allocate extra space when NETSCAPE_HANG_BUG defined. X-Git-Tag: OpenSSL_1_0_2-beta2~183 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=856a4585d6f7a856b90c93792cf1c1ed968d4a4b;p=oweals%2Fopenssl.git Allocate extra space when NETSCAPE_HANG_BUG defined. Make sure there is an extra 4 bytes for server done message when NETSCAPE_HANG_BUG is defined. PR#3361 (cherry picked from commit 92d81ba622396425764d676ba4fb3f0dac273f17) --- diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index 36f34270cd..a503042203 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -2146,6 +2146,11 @@ int ssl3_send_certificate_request(SSL *s) #ifdef NETSCAPE_HANG_BUG if (!SSL_IS_DTLS(s)) { + if (!BUF_MEM_grow_clean(buf, s->init_num + 4)) + { + SSLerr(SSL_F_SSL3_SEND_CERTIFICATE_REQUEST,ERR_R_BUF_LIB); + goto err; + } p=(unsigned char *)s->init_buf->data + s->init_num; /* do the header */ *(p++)=SSL3_MT_SERVER_DONE;