From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 25 May 2021 21:02:37 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1llcK5-0005xM-Eo for lore@lore.pengutronix.de; Tue, 25 May 2021 21:02:37 +0200 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llcK4-0002gq-5S for lore@pengutronix.de; Tue, 25 May 2021 21:02:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=YWE0V0BhK2+mpeUYiNHUT/MLtr9zTzkdP1j9MEuSj/c=; b=RbLCV6KeTexIzV hyhgUJHJcS+KSaqs7yJ8AAXB8lMcXZzRAXiQqEQC2LaroVkvPzgrls0yBaIbPRiAw/mRqHlg0k70E WosklO1yLC/A1SKYwNKLqC3HVJhuAzoql4GdGX/a8bLQ+RJTl9nDh8l48CmtyyXo4O+/VbaBqVZQ0 BaHs7qMNkhD6PfEbKoiQE0qIVnL0EHsUUPUXtnVYLQcCTnUXb8AYb3eaXqZCXRKg3+ZWVvlbdhnN6 2QfAwf0HSAg5U/OX2uLX5DPWL+Jb7Yzvi+0QN+pck3AoZ0ZwGuLoyg1/Od5oMjvk27rc34KDqI0SS GKPNYi3ENN/NOJXMyy+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1llcIJ-007VER-Gu; Tue, 25 May 2021 19:00:48 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1llbvu-007K6v-07 for barebox@lists.infradead.org; Tue, 25 May 2021 18:37:39 +0000 Received: from dude03.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::39]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1llbvp-0008Bd-BW for barebox@lists.infradead.org; Tue, 25 May 2021 20:37:33 +0200 From: Lucas Stach To: barebox@lists.infradead.org Date: Tue, 25 May 2021 20:37:32 +0200 Message-Id: <20210525183733.3345497-1-l.stach@pengutronix.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210525_113738_080708_A0A505F2 X-CRM114-Status: GOOD ( 10.40 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:e::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Subject: [PATCH 1/2] uncompress: use read_full to fill decompression buffer X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.ext.pengutronix.de) 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 --- lib/uncompress.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/uncompress.c b/lib/uncompress.c index c47d319dbb5f..5c0d1e9f4d66 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) -- 2.29.2 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox