From: Jonathan Bastien-Filiatrault Date: Wed, 8 Sep 2010 22:34:41 +0000 (-0400) Subject: mbuffers: Make _mbuffer_remove_bytes return a meaningful error code. X-Git-Tag: gnutls_2_11_3~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=363ad5cf711bd56d268e70c298bd7be4fbd8ef28;p=thirdparty%2Fgnutls.git mbuffers: Make _mbuffer_remove_bytes return a meaningful error code. Signed-off-by: Jonathan Bastien-Filiatrault Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/lib/gnutls_mbuffers.c b/lib/gnutls_mbuffers.c index 630f53a2c2..7ebcc4090f 100644 --- a/lib/gnutls_mbuffers.c +++ b/lib/gnutls_mbuffers.c @@ -186,7 +186,10 @@ _mbuffer_remove_bytes (mbuffer_head_st *buf, size_t bytes) mbuffer_st *bufel, *next; if (bytes > buf->byte_length) - return -1; + { + gnutls_assert (); + return GNUTLS_E_INVALID_REQUEST; + } for (bufel = buf->head; bufel != NULL && left > 0; bufel = next) {