Skip to content

Commit

Permalink
Decompressors: check for write errors in decompress_unlzo.c
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Alain Knaff <[email protected]>
Cc: Albin Tonnerre <[email protected]>
Cc: Phillip Lougher <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Larhzu authored and torvalds committed Jan 13, 2011
1 parent eb0cf3e commit 8f9b54a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/decompress_unlzo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8f9b54a

Please sign in to comment.