[or-cvs] Apparently, zlib sometimes reports Z_BUF_ERROR on input exh...

Nick Mathewson nickm at seul.org
Sat Jun 24 02:06:55 UTC 2006


Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv31238/src/common

Modified Files:
	torgzip.c 
Log Message:
Apparently, zlib sometimes reports Z_BUF_ERROR on input exhaustion as well as on running out of output space.  This could well fix the assert bug reported by weasel and arma.

Index: torgzip.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/torgzip.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -p -d -r1.34 -r1.35
--- torgzip.c	18 Jun 2006 07:24:29 -0000	1.34
+++ torgzip.c	24 Jun 2006 02:06:52 -0000	1.35
@@ -348,6 +348,8 @@ tor_zlib_process(tor_zlib_state_t *state
     case Z_STREAM_END:
       return TOR_ZLIB_DONE;
     case Z_BUF_ERROR:
+      if (state->stream.avail_in == 0)
+        return Z_OK;
       return TOR_ZLIB_BUF_FULL;
     case Z_OK:
       if (state->stream.avail_out == 0)



More information about the tor-commits mailing list