Make grub_zlib_decompress handle incomplete chunks.

Fixes squash4.
This commit is contained in:
Vladimir Serbinenko 2013-12-18 23:39:49 +01:00
parent 2984035e1a
commit 2e238b3708
5 changed files with 38 additions and 14 deletions

View file

@ -1303,12 +1303,6 @@ grub_zlib_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
ret = grub_gzio_read_real (gzio, off, outbuf, outsize);
grub_free (gzio);
if (!grub_errno && ret != (grub_ssize_t) outsize)
{
grub_error (GRUB_ERR_BAD_COMPRESSED_DATA, "premature end of compressed");
ret = -1;
}
/* FIXME: Check Adler. */
return ret;
}