diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-07-03 11:51:20 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-07-13 08:48:06 +0200 |
commit | 64df8840e18b31ddd9f3d246c62854f428e0c632 (patch) | |
tree | 954f87df848b93f0babe25a648f964cbd6cfdcbd /lib/buffers.c | |
parent | 1225fb84edf6da1798d78c276093642a7e186203 (diff) | |
download | gnutls-64df8840e18b31ddd9f3d246c62854f428e0c632.tar.gz |
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 <nmav@redhat.com>
Diffstat (limited to 'lib/buffers.c')
-rw-r--r-- | lib/buffers.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 |