From 64df8840e18b31ddd9f3d246c62854f428e0c632 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 3 Jul 2017 11:51:20 +0200 Subject: record: more precise calculation of max recv size Previously we were using a rough calculation of the max recv size based on maximum values. Now we calculate the exact maximum value once the epoch is initialized and enforce it throughout the session. Signed-off-by: Nikos Mavrogiannopoulos --- lib/buffers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/buffers.c') diff --git a/lib/buffers.c b/lib/buffers.c index 107a9ca9ca..abe4db840e 100644 --- a/lib/buffers.c +++ b/lib/buffers.c @@ -540,8 +540,8 @@ _gnutls_io_read_buffered(gnutls_session_t session, size_t total, size_t recvdata, readsize; if (total > max_record_recv_size(session) || total == 0) { - gnutls_assert(); /* internal error */ - return GNUTLS_E_INVALID_REQUEST; + gnutls_assert(); + return GNUTLS_E_RECORD_OVERFLOW; } /* calculate the actual size, ie. get the minimum of the -- cgit v1.2.1