Check there is enough room for extension.
(Imported from upstream's 56b94a38b9a2197210a110c4a01a39ac75b34ce8)
This commit is contained in:
@@ -1488,6 +1488,8 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf, unsigned c
|
||||
|
||||
#ifndef OPENSSL_NO_HEARTBEATS
|
||||
/* Add Heartbeat extension */
|
||||
if ((limit - ret - 4 - 1) < 0)
|
||||
return NULL;
|
||||
s2n(TLSEXT_TYPE_heartbeat,ret);
|
||||
s2n(1,ret);
|
||||
/* Set mode:
|
||||
@@ -1850,6 +1852,8 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf, unsigned c
|
||||
/* Add Heartbeat extension if we've received one */
|
||||
if (s->tlsext_heartbeat & SSL_TLSEXT_HB_ENABLED)
|
||||
{
|
||||
if ((limit - ret - 4 - 1) < 0)
|
||||
return NULL;
|
||||
s2n(TLSEXT_TYPE_heartbeat,ret);
|
||||
s2n(1,ret);
|
||||
/* Set mode:
|
||||
|
||||
Reference in New Issue
Block a user