zlib-ng: deflate_quick invalid stored block lengths error
@nmoinvaz I found a problem with one of the recent changes to deflate_quick
minigzip attempts a decompress and reports./minigzip: /tmp/zlib-testfil.gz: invalid stored block lengths
Same file with gzip: gzip: /tmp/zlib-testfil.gz: invalid compressed data--format violated
I bisected this to 343596fc98a0d7a6283dbe5d25abefca18439184.
The way I catched this was to set BUFLEN to 1MIB, like this:
CFLAGS="-DBUFLEN=1048576" ./configure --warn && make
etc, and this triggered with my testdata.
With the default buflen, it does not get any errors. I suspect this is a problem that could occur in normal systems as well, and might be the one @neurolabusc is currently getting as well
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (14 by maintainers)
Commits related to this issue
- Fixed invalid deflate quick output when flush_pending didn't flush due to s->strm->avail_out == 0. We check that there is input data available to process and output space to write to, which allows us ... — committed to nmoinvaz/zlib-ng by nmoinvaz 4 years ago
- Fixed invalid deflate quick output when flush_pending didn't flush due to s->strm->avail_out == 0. We check that there is input data available to process and output space to write to, which allows us ... — committed to nmoinvaz/zlib-ng by nmoinvaz 4 years ago
I just got it to reproduce, it was some bad code w/r to BUFLEN. I think I am going to submit some changes
minigzip
that would allow large BUFLEN, and then some changes toswitchlevels
that would allow custom window bits.