bug 1083: Fix infinite loop in decompress_data
commitcd2eeef5f7093c144015f3a43427924eb258e24d
authorKalle Olavi Niemitalo <kon@iki.fi>
Sat, 15 Aug 2009 10:44:03 +0000 (15 13:44 +0300)
committerKalle Olavi Niemitalo <Kalle@Astalo.kon.iki.fi>
Sat, 15 Aug 2009 10:48:59 +0000 (15 13:48 +0300)
tree4945ea85a60909377774b7a255b8148902ae3c92
parent4369b052ef2e47d89487a566386a0e8faceecc1c
bug 1083: Fix infinite loop in decompress_data

decompress_data() supposed that read_encoded() would return a positive
number if it decompressed something, 0 if no data is available yet but
may be later, or -1 if no more data will be available.  However,
several backends actually returned 0 if they had seen an EOF marker or
an error in the stream, causing decompress_data() to keep calling
them.  Make them return -1 in this situation.
NEWS
src/encoding/bzip2.c
src/encoding/deflate.c
src/encoding/encoding.c
src/encoding/lzma.c