aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/unlzo.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2011-11-11 14:35:05 +0100
committerLasse Collin <lasse.collin@tukaani.org>2011-11-11 14:35:05 +0100
commit1fdb4c9a338713db7abda4dbe81fb09d61e16699 (patch)
treecdab940375d59f0868ecbc7d60e657406f11e1e3 /xen/common/unlzo.c
parent24bde2170dde6ed1a4a3de7c96a019eb4dae9501 (diff)
downloadxen-1fdb4c9a338713db7abda4dbe81fb09d61e16699.tar.gz
xen-1fdb4c9a338713db7abda4dbe81fb09d61e16699.tar.bz2
xen-1fdb4c9a338713db7abda4dbe81fb09d61e16699.zip
Decompressors: check for write errors in unlzo.c
From: Lasse Collin <lasse.collin@tukaani.org> The return value of flush() is not checked in unlzo(). This means that the decompressor won't stop even if the caller doesn't want more data. This can happen e.g. with a corrupt LZO-compressed initramfs image. Signed-off-by: Lasse Collin <lasse.collin@tukaani.org> Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/common/unlzo.c')
-rw-r--r--xen/common/unlzo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
index 08117e244e..f3fb098f31 100644
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -202,8 +202,8 @@ STATIC int INIT unlzo(u8 *input, unsigned int in_len,
}
}
- if (flush)
- flush(out_buf, dst_len);
+ if (flush && flush(out_buf, dst_len) != dst_len)
+ goto exit_2;
if (output)
out_buf += dst_len;
if (posp)