gzip -d would fail with a CRC error...
authorJim Meyering <meyering@redhat.com>
Sun, 10 Jan 2010 19:53:10 +0000 (20:53 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 11 Jan 2010 07:33:47 +0000 (08:33 +0100)
commitb9e94c93df914bd1d9eec9f150b2e4e00702ae7b
tree60ceecfa709479b0a1d176e6efb9e908b9072124
parent1b3081d92a10bf8bfb9697c179e81b1f5c760bff
gzip -d would fail with a CRC error...

...for some inputs, and some memcpy implementations.  It is possible
that an offending input has to be compressed "from FAT filesystem
(MS-DOS, OS/2, NT)", since the sole reproducer no longer evokes a
CRC error when uncompressed and recompressed on a GNU/Linux system.
Also, using an unpatched reverse-memcpy-gzip on over 100,000 inputs
on a GNU/Linux system did not turn up another reproducer.
* inflate.c (inflate_codes): Don't call memcpy with overlapping regions.
Properly detect when source and destination overlap.
* tests/memcpy-abuse: New test, to trigger misbehavior.
* Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
Reported by Alain Magloire in
http://thread.gmane.org/gmane.comp.gnu.gzip.bugs/307
Makefile.am
NEWS
inflate.c
tests/memcpy-abuse [new file with mode: 0755]