diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2010-11-25 20:03:24 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2010-11-25 20:03:24 +0200 |
commit | 64c515e42b2266e38a45cff12b4fe8cb0f6682af (patch) | |
tree | 199e98f0f52c1f4c2c2d62015086210976e8e6bd /linux/lib | |
parent | 80b1069c48abf9271753ce9ad29259a654b72448 (diff) | |
download | xz-embedded-64c515e42b2266e38a45cff12b4fe8cb0f6682af.tar.gz |
Don't flush() with an empty buffer in unxz().
Thanks to Phillip Lougher.
Diffstat (limited to 'linux/lib')
-rw-r--r-- | linux/lib/decompress_unxz.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/linux/lib/decompress_unxz.c b/linux/lib/decompress_unxz.c index c6eabd7..000332c 100644 --- a/linux/lib/decompress_unxz.c +++ b/linux/lib/decompress_unxz.c @@ -319,7 +319,8 @@ STATIC int INIT unxz(unsigned char *in, int in_size, ret = xz_dec_run(s, &b); - if (b.out_pos == b.out_size || ret != XZ_OK) { + if (b.out_pos == b.out_size + || (ret != XZ_OK && b.out_pos > 0)) { /* * Setting ret here may hide an error * returned by xz_dec_run(), but probably |