Merge remote-tracking branch 'public/bug11824_v2'

This commit is contained in:
Nick Mathewson 2014-10-22 11:01:50 -04:00
commit 653221e807
2 changed files with 6 additions and 1 deletions

5
changes/bug11824 Normal file
View File

@ -0,0 +1,5 @@
o Minor bugfixes:
- When trying to finalize a zlib stream where we have already
exhausted all the input bytes and we need more bytes in the
output buffer, do not report the the write as successful.
Fixes bug 11824; bugfix on 0.1.1.23.

View File

@ -511,7 +511,7 @@ 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)
if (state->stream.avail_in == 0 && !finish)
return TOR_ZLIB_OK;
return TOR_ZLIB_BUF_FULL;
case Z_OK: