summaryrefslogtreecommitdiff
path: root/lib/gnutls_buffers.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gnutls_buffers.c')
-rw-r--r--lib/gnutls_buffers.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gnutls_buffers.c b/lib/gnutls_buffers.c
index a044f316fc..f5a7d79cfc 100644
--- a/lib/gnutls_buffers.c
+++ b/lib/gnutls_buffers.c
@@ -377,6 +377,11 @@ int gnutls_insertHashDataBuffer( GNUTLS_STATE state, char *data, int length)
old_buffer = state->gnutls_internals.hash_buffer.size;
state->gnutls_internals.hash_buffer.size += length;
+ if (state->gnutls_internals.max_handshake_data_buffer_size > 0 && state->gnutls_internals.hash_buffer.size > state->gnutls_internals.max_handshake_data_buffer_size) {
+ gnutls_assert();
+ return GNUTLS_E_MEMORY_ERROR;
+ }
+
#ifdef BUFFERS_DEBUG
_gnutls_log( "HASH BUFFER: Inserted %d bytes of Data\n", length);
#endif