]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
mbuffers: Make _mbuffer_remove_bytes return a meaningful error code.
authorJonathan Bastien-Filiatrault <joe@x2a.org>
Wed, 8 Sep 2010 22:34:41 +0000 (18:34 -0400)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 9 Sep 2010 06:34:52 +0000 (08:34 +0200)
Signed-off-by: Jonathan Bastien-Filiatrault <joe@x2a.org>
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
lib/gnutls_mbuffers.c

index 630f53a2c2806fc2dda6417d751c01969a931439..7ebcc4090ff217582fda645f8f31c786dbeab239 100644 (file)
@@ -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)
     {