From 49a0fbd0183f032a6d5926fbb951d135e994350b Mon Sep 17 00:00:00 2001 From: marko <> Date: Wed, 6 Sep 2006 09:51:00 +0000 Subject: [PATCH] branches/zip: btr_copy_externally_stored_field(): Add diagnostics for unexpected end of compressed BLOB. --- btr/btr0cur.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/btr/btr0cur.c b/btr/btr0cur.c index 171bcc79902..c02bccbaadd 100644 --- a/btr/btr0cur.c +++ b/btr/btr0cur.c @@ -4267,8 +4267,6 @@ btr_copy_externally_stored_field( /* fall through */ default: inflate_error: - mtr_commit(&mtr); - inflateEnd(&d_stream); ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: inflate() of" @@ -4276,11 +4274,25 @@ inflate_error: " page %lu space %lu returned %d\n", (ulong) page_no, (ulong) space_id, err); +err_exit: + mtr_commit(&mtr); + inflateEnd(&d_stream); *len = 0; return(buf); } if (next_page_no == FIL_NULL) { + if (!d_stream.avail_in) { + ut_print_timestamp(stderr); + fprintf(stderr, + " InnoDB: unexpected end of" + " compressed BLOB" + " page %lu space %lu\n", + (ulong) page_no, + (ulong) space_id); + goto err_exit; + } + err = inflate(&d_stream, Z_FINISH); if (UNIV_UNLIKELY(err != Z_STREAM_END)) {