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>
This commit is contained in:
Lasse Collin committed 2011-11-11 14:35:05 +01:00
1 parent 24bde2170d
commit 1fdb4c9a33
1 file changed
+2 -2
+2 -2
View File
@@ -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)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.