summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/record.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/record.c b/lib/record.c
index 2dc997d09b..08aad540db 100644
--- a/lib/record.c
+++ b/lib/record.c
@@ -1547,6 +1547,15 @@ _gnutls_recv_in_buffers(gnutls_session_t session, content_type_t type,
goto begin;
}
+ if (_mbuffer_get_udata_size(decrypted) > max_decrypted_size(session)) {
+ _gnutls_audit_log
+ (session, "Received packet with illegal length: %u\n",
+ (unsigned int) ret);
+
+ ret = gnutls_assert_val(GNUTLS_E_RECORD_OVERFLOW);
+ goto sanity_check_error;
+ }
+
#ifdef ENABLE_SSL2
if (record.v2) {
decrypted->htype = GNUTLS_HANDSHAKE_CLIENT_HELLO_V2;