summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/ssl/d1_both.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/ssl/d1_both.c')
-rw-r--r--crypto/openssl/ssl/d1_both.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/openssl/ssl/d1_both.c b/crypto/openssl/ssl/d1_both.c
index 89cdca8..2e4250f 100644
--- a/crypto/openssl/ssl/d1_both.c
+++ b/crypto/openssl/ssl/d1_both.c
@@ -1492,6 +1492,9 @@ dtls1_process_heartbeat(SSL *s)
/* Read type and payload length first */
if (1 + 2 + 16 > s->s3->rrec.length)
return 0; /* silently discard */
+ if (s->s3->rrec.length > SSL3_RT_MAX_PLAIN_LENGTH)
+ return 0; /* silently discard per RFC 6520 sec. 4 */
+
hbtype = *p++;
n2s(p, payload);
if (1 + 2 + payload + 16 > s->s3->rrec.length)
OpenPOWER on IntegriCloud