GNU bug report logs -
#33133
26.1.50; zlib-decompress-region too rigid
Previous Next
Reported by: Katsumi Yamaoka <yamaoka <at> jpl.org>
Date: Tue, 23 Oct 2018 23:10:02 UTC
Severity: normal
Tags: fixed, patch
Found in version 26.1.50
Fixed in version 27.1
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Katsumi Yamaoka <yamaoka <at> jpl.org> writes:
> Whereas `gzip -d' does, zlib-decompress-region doesn't decompress
> corrupted data of a certain kind. For instance, visiting
>
> https://www.gutenberg.org/no-such-page-exists
>
> using eww shows raw gzipped data. The data extracted is attached.
> As for `gzip -d', it says "unexpected end of file" in stderr.
> If there is no prospect to improve zlib-decompress-region, how
> about this workaround?
We could have zlib-decompress-region ignore unexpected eof as well,
e.g., the below (though it should obviously be enhanced to depend on a
new parameter):
--- i/src/decompress.c
+++ w/src/decompress.c
@@ -206,7 +206,7 @@ DEFUN ("zlib-decompress-region", Fzlib_decompress_region,
}
while (inflate_status == Z_OK);
- if (inflate_status != Z_STREAM_END)
+ if (inflate_status != Z_STREAM_END && inflate_status != Z_BUF_ERROR)
return unbind_to (count, Qnil);
unwind_data.start = 0;
This bug report was last modified 6 years and 51 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.