From 8496462a2470f735283638ffcaa280e46fc50f7e Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Wed, 26 May 2021 11:02:15 +0200 Subject: uncompress: use read_full to fill decompression buffer The decompression algorithms want all of the requested buffer size to be filled and don't cope with less bytes being returned. Use read_full to satisfy this requirement. Signed-off-by: Lucas Stach Link: https://lore.barebox.org/20210526090216.4003977-1-l.stach@pengutronix.de Signed-off-by: Sascha Hauer --- lib/uncompress.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/uncompress.c b/lib/uncompress.c index c47d319dbb..5c0d1e9f4d 100644 --- a/lib/uncompress.c +++ b/lib/uncompress.c @@ -24,6 +24,7 @@ #include #include #include +#include static void *uncompress_buf; static unsigned int uncompress_size; @@ -142,7 +143,7 @@ static int uncompress_infd, uncompress_outfd; static int fill_fd(void *buf, unsigned int len) { - return read(uncompress_infd, buf, len); + return read_full(uncompress_infd, buf, len); } static int flush_fd(void *buf, unsigned int len) -- cgit v1.2.3