From af4c6e348e4bad6303e7d214cdcf2536487aabe4 Mon Sep 17 00:00:00 2001 From: Erik Auerswald Date: Tue, 26 Aug 2014 22:50:34 -0400 Subject: [PATCH] RT3301: Discard too-long heartbeat requests Reviewed-by: Tim Hudson --- ssl/d1_both.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 33d0ae3ce4..f2ff943001 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -1363,6 +1363,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) -- 2.25.1