Allocate extra space when NETSCAPE_HANG_BUG defined.
authorDavid Ramos <daramos@stanford.edu>
Sun, 1 Jun 2014 13:30:10 +0000 (14:30 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 1 Jun 2014 13:30:10 +0000 (14:30 +0100)
Make sure there is an extra 4 bytes for server done message when
NETSCAPE_HANG_BUG is defined.

PR#3361

ssl/s3_srvr.c

index 4de9d1900f5dde61719af41674379ebcf0a2f042..5ac4119b9d85e3d99c0e27a68fd90e3c61e89183 100644 (file)
@@ -2097,6 +2097,11 @@ int ssl3_send_certificate_request(SSL *s)
                s->init_num=n+4;
                s->init_off=0;
 #ifdef NETSCAPE_HANG_BUG
+               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 */