summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2021-05-26 11:02:15 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-05-27 08:50:38 +0200
commit8496462a2470f735283638ffcaa280e46fc50f7e (patch)
tree661a21fe637883d08f271f72ae44ea4e4d199709
parent6596a182cacba78d2f2346a083b1f6d72f707700 (diff)
downloadbarebox-8496462a2470f735283638ffcaa280e46fc50f7e.tar.gz
barebox-8496462a2470f735283638ffcaa280e46fc50f7e.tar.xz
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 <l.stach@pengutronix.de> Link: https://lore.barebox.org/20210526090216.4003977-1-l.stach@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--lib/uncompress.c3
1 files changed, 2 insertions, 1 deletions
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 <filetype.h>
#include <malloc.h>
#include <fs.h>
+#include <libfile.h>
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)