mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 09:16:33 +00:00
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: Lasse Collin <lasse.collin@tukaani.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Alain Knaff <alain@knaff.lu> Cc: Albin Tonnerre <albin.tonnerre@free-electrons.com> Cc: Phillip Lougher <phillip@lougher.demon.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
eb0cf3e19b
commit
8f9b54a35a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user