diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c index b6edec7..5a64477 100644 --- a/lib/bootstrap/devfs.c +++ b/lib/bootstrap/devfs.c @@ -58,8 +58,12 @@ 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;