gnutls-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in gnutls breaking Pidgin Jabber support


From: Tim Kosse
Subject: Re: Bug in gnutls breaking Pidgin Jabber support
Date: Mon, 29 Jun 2009 10:01:07 +0200
User-agent: Thunderbird 2.0.0.22 (Windows/20090605)

Hi,

found the problem. Happens if _gnutls_io_write_buffered gets called with
iptr == NULL and n < session->internals.record_send_buffer.length

It then gets up to n bytes from the send buffer into ptr. At that point
session->internals.record_send_buffer still contains additional
outstanding data.

If sending fails, it pushes the remaining data from ptr to the end of
the send buffer, causing the buffer contents to become reordered.
Instead it should have put it to the beginning. A gnutls_buffer_prepend
function would be needed.

A workaround is to always request the complete buffer, see attached
patch. That's identical to the behavior of older GnuTLS versions.

Tim

--- gnutls_buffers.c_old        2009-06-29 09:57:46.000000000 +0200
+++ gnutls_buffers.c    2009-06-29 09:58:01.000000000 +0200
@@ -657,7 +657,7 @@
     {
       gnutls_datum bdata;
       /* checking is handled above */
-      _gnutls_buffer_get_datum (&session->internals.record_send_buffer, 
&bdata, n);
+      _gnutls_buffer_get_datum (&session->internals.record_send_buffer, 
&bdata, session->internals.record_send_buffer.length);
 
       ptr = bdata.data;
       n = bdata.size;

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]