File 0708-ssl-Fix-error-handling.patch of Package erlang
From 036da0e4a45b90b4fa2059212c84d2aa9ead33c8 Mon Sep 17 00:00:00 2001
From: Dan Gudmundsson <dgud@erlang.org>
Date: Mon, 11 Oct 2021 10:55:14 +0200
Subject: [PATCH 08/10] ssl: Fix error handling
Overflow check picked the wrong lenght.
---
lib/ssl/src/dtls_record.erl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/ssl/src/dtls_record.erl b/lib/ssl/src/dtls_record.erl
index ef275fad4c..da8d19d6ed 100644
--- a/lib/ssl/src/dtls_record.erl
+++ b/lib/ssl/src/dtls_record.erl
@@ -455,7 +455,8 @@ get_dtls_records_aux({_, _, Version, _} = Vinfo, <<?BYTE(Type),?BYTE(MajVer),?BY
?ALERT_REC(?FATAL, ?BAD_RECORD_MAC)
end;
get_dtls_records_aux(_, <<?BYTE(_), ?BYTE(_MajVer), ?BYTE(_MinVer),
- ?UINT16(Length), _/binary>>,
+ ?UINT16(_Epoch), ?UINT48(_Seq),
+ ?UINT16(Length), _/binary>>,
_Acc, _) when Length > ?MAX_CIPHER_TEXT_LENGTH ->
?ALERT_REC(?FATAL, ?RECORD_OVERFLOW);
--
2.31.1