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

Ian Peters itp at ximian.com
Thu Mar 6 17:13:01 CET 2003


On Thu, 2003-03-06 at 03:34, Nikos Mavroyanopoulos wrote:
> On Wed, Mar 05, 2003 at 05:50:56PM -0500, Ian Peters wrote:
> 
> > 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.
> Hello Ian.
>   I've quite changed that patch. Does the attached also solve the problem?

With a little massaging to apply cleanly to my 0.8.3 tree, it works
perfectly, thanks.

FWIW, if you edit any of your source in lib/ or libextra/ of a
distributed gnutls tarball, you have to comment out the all-local target
in the Makefile to get it to stop trying to build the docs, as it's
looking for ../doc/scripts/gdoc, which isn't distributed.

Ian





More information about the Gnutls-devel mailing list