From: Nick Mathewson Date: Sat, 24 Jun 2006 02:06:52 +0000 (+0000) Subject: Apparently, zlib sometimes reports Z_BUF_ERROR on input exhaustion as well as on... X-Git-Tag: tor-0.1.1.23~164 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06e09cdd47eaa8f7e90ce2c3df9b4b2042b195f3;p=thirdparty%2Ftor.git 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. svn:r6682 --- diff --git a/src/common/torgzip.c b/src/common/torgzip.c index c08ed514d8..aca8386cc7 100644 --- a/src/common/torgzip.c +++ b/src/common/torgzip.c @@ -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)