Browse Source

branches/zip: page_zip_compress(): Do not call deflate(&c_stream, Z_FULL_FLUSH)

unless more than 6 bytes are available for the output.  This should remove
the possibility that deflate() returns Z_OK without consuming all input.
pull/374/head
marko 18 years ago
parent
commit
4b23d55164
  1. 3
      page/page0zip.c

3
page/page0zip.c

@ -1142,7 +1142,8 @@ page_zip_compress(
trx_id_col = ULINT_UNDEFINED;
}
if (UNIV_UNLIKELY(c_stream.avail_out < n_dense * slot_size)) {
if (UNIV_UNLIKELY(c_stream.avail_out <= n_dense * slot_size
+ 6/* sizeof(zlib header and footer) */)) {
goto zlib_error;
}

Loading…
Cancel
Save