From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pd0-x22b.google.com ([2607:f8b0:400e:c02::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yp0HN-0001vP-60 for barebox@lists.infradead.org; Sun, 03 May 2015 20:14:21 +0000 Received: by pdea3 with SMTP id a3so145187552pde.3 for ; Sun, 03 May 2015 13:13:59 -0700 (PDT) From: Andrey Smirnov Date: Sun, 3 May 2015 13:13:19 -0700 Message-Id: <1430683999-5910-8-git-send-email-andrew.smirnov@gmail.com> In-Reply-To: <1430683999-5910-1-git-send-email-andrew.smirnov@gmail.com> References: <1430683999-5910-1-git-send-email-andrew.smirnov@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 8/8] bootstrap: Warn if image size in BB header is zero To: barebox@lists.infradead.org Cc: Andrey Smirnov Signed-off-by: Andrey Smirnov --- lib/bootstrap/devfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c index d7b5185..d071eb3 100644 --- a/lib/bootstrap/devfs.c +++ b/lib/bootstrap/devfs.c @@ -58,8 +58,12 @@ static unsigned int get_image_size(void *head) unsigned int ret = 0; unsigned int *psize = head + BAREBOX_HEAD_SIZE_OFFSET; - if (is_barebox_head(head)) + if (is_barebox_head(head)) { ret = *psize; + if (!ret) + bootstrap_err( + "image has correct magic, but the length is zero\n"); + } debug("Detected barebox image size %u\n", ret); return ret; -- 2.1.4 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox