From 64c515e42b2266e38a45cff12b4fe8cb0f6682af Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Thu, 25 Nov 2010 20:03:24 +0200 Subject: Don't flush() with an empty buffer in unxz(). Thanks to Phillip Lougher. --- linux/lib/decompress_unxz.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'linux') 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 -- cgit v1.2.3