aboutsummaryrefslogtreecommitdiff
path: root/src/common/torgzip.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-06-24 02:06:52 +0000
committerNick Mathewson <nickm@torproject.org>2006-06-24 02:06:52 +0000
commit06e09cdd47eaa8f7e90ce2c3df9b4b2042b195f3 (patch)
tree770c386ce648c80d67aa7703a5452afa4dfe9003 /src/common/torgzip.c
parentaafc309414a3e629e32f451d8306015acd0c42b5 (diff)
downloadtor-06e09cdd47eaa8f7e90ce2c3df9b4b2042b195f3.tar
tor-06e09cdd47eaa8f7e90ce2c3df9b4b2042b195f3.tar.gz
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
Diffstat (limited to 'src/common/torgzip.c')
-rw-r--r--src/common/torgzip.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/torgzip.c b/src/common/torgzip.c
index c08ed514d..aca8386cc 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)