Commit af4c6e34 authored by Erik Auerswald's avatar Erik Auerswald Committed by Rich Salz
Browse files

RT3301: Discard too-long heartbeat requests



Reviewed-by: default avatarTim Hudson <tjh@openssl.org>
parent 98ecf60b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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)