Commit 8f9b54a3 authored by Lasse Collin's avatar Lasse Collin Committed by Linus Torvalds

Decompressors: check for write errors in decompress_unlzo.c

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: default avatarLasse Collin <>
Cc: "H. Peter Anvin" <>
Cc: Alain Knaff <>
Cc: Albin Tonnerre <>
Cc: Phillip Lougher <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent eb0cf3e1
......@@ -187,8 +187,8 @@ STATIC inline int INIT unlzo(u8 *input, 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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment