[gnutls-dev][PATCH] inappropriate buffer check in _gnutls_io_read_buffered

Ian Peters itp at ximian.com
Wed Mar 5 23:54:02 CET 2003


Hi,

I'm integrating GnuTLS support into our internal HTTP transfer library,
and I was running into some problems with UNEXPECTED_PACKET_LENGTH
errors.  I eventually tracked these down to one place, in
_gnutls_recv_int, which calls _gnutls_io_read_buffered.

The first check in that function verifies that the received packet isn't
larger than the MAX_RECV_SIZE, but the third condition appears to be
bogus.  Specifically, _gnutls_io_read_buffered will be recalled in cases
where GNUTLS_E_AGAIN, which lead to the function incorrectly returning
GNUTLS_E_INVALID_REQUEST.  The attached patch seems to fix the issue.

Ian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnutls-_gnutls_io_read_buffered.patch
Type: text/x-patch
Size: 582 bytes
Desc: not available
URL: </pipermail/attachments/20030305/7c23fdfb/attachment.bin>


More information about the Gnutls-devel mailing list