[PATCH 2/8] mbuffers: Make _mbuffer_remove_bytes return a meaningful error code.

Jonathan Bastien-Filiatrault joe at x2a.org
Thu Sep 9 00:34:41 CEST 2010


Signed-off-by: Jonathan Bastien-Filiatrault <joe at x2a.org>

diff --git a/lib/gnutls_mbuffers.c b/lib/gnutls_mbuffers.c
index 630f53a..7ebcc40 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)
     {
-- 
1.7.1





More information about the Gnutls-devel mailing list