summaryrefslogtreecommitdiff
path: root/lib/gnutls_record.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-12-15 18:15:39 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-12-15 18:15:39 +0100
commit510eee1107d9e7929416d5922f46a61b5043c6dd (patch)
treefc8e017ba6258faeccc4cf4eb789c5557340cc35 /lib/gnutls_record.c
parent098857c141fed8c70600a1c457dd1efd211dc634 (diff)
downloadgnutls-510eee1107d9e7929416d5922f46a61b5043c6dd.tar.gz
simplified _mbuffer_alloc
Diffstat (limited to 'lib/gnutls_record.c')
-rw-r--r--lib/gnutls_record.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c
index 8d70505337..00c9f27f86 100644
--- a/lib/gnutls_record.c
+++ b/lib/gnutls_record.c
@@ -501,7 +501,7 @@ _gnutls_send_tlen_int(gnutls_session_t session, content_type_t type,
/* now proceed to packet encryption
*/
cipher_size = MAX_RECORD_SEND_SIZE(session);
- bufel = _mbuffer_alloc(0, cipher_size + CIPHER_SLACK_SIZE);
+ bufel = _mbuffer_alloc(cipher_size + CIPHER_SLACK_SIZE);
if (bufel == NULL)
return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR);
@@ -1199,10 +1199,11 @@ _gnutls_recv_in_buffers(gnutls_session_t session, content_type_t type,
* they are encrypted).
*/
ret = max_decrypted_size(session) + MAX_PAD_SIZE + MAX_HASH_SIZE;
- decrypted = _mbuffer_alloc(ret, ret);
+ decrypted = _mbuffer_alloc(ret);
if (decrypted == NULL)
return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR);
+ _mbuffer_set_udata_size(decrypted, ret);
ciphertext.data =
(uint8_t *) _mbuffer_get_udata_ptr(bufel) + record.header_size;
ciphertext.size = record.length;