Преглед изворни кода

Merge remote-tracking branch 'public/bug11824_v2'

Nick Mathewson пре 9 година
родитељ
комит
653221e807
2 измењених фајлова са 6 додато и 1 уклоњено
  1. 5 0
      changes/bug11824
  2. 1 1
      src/common/torgzip.c

+ 5 - 0
changes/bug11824

@@ -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.

+ 1 - 1
src/common/torgzip.c

@@ -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: