aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2010-11-25 20:03:24 +0200
committerLasse Collin <lasse.collin@tukaani.org>2010-11-25 20:03:24 +0200
commit64c515e42b2266e38a45cff12b4fe8cb0f6682af (patch)
tree199e98f0f52c1f4c2c2d62015086210976e8e6bd
parent80b1069c48abf9271753ce9ad29259a654b72448 (diff)
downloadxz-embedded-64c515e42b2266e38a45cff12b4fe8cb0f6682af.tar.gz
Don't flush() with an empty buffer in unxz().
Thanks to Phillip Lougher.
-rw-r--r--linux/lib/decompress_unxz.c3
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