[PATCH] mkimage: clarify error message for empty input files

Tom Rini trini at konsulko.com
Thu Sep 2 15:28:58 CEST 2021


On Sun, Aug 01, 2021 at 03:23:13PM -0700, Thomas Hebb wrote:

> Currently, an empty imput file causes `mmap()` to fail, and you get an
> error like "mkimage: Can't read file.img: Invalid argument", which is
> extremely unintuitive and hard to diagnose if you don't know what to
> look for. Add an explicit check for an empty file and provide a clear
> error message instead.
> 
> We already bounds check the image size when listing and re-signing
> existing images, so we only need this check here, when opening data
> files going into a image.
> 
> Signed-off-by: Thomas Hebb <tommyhebb at gmail.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>

Applied to u-boot/next, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210902/fea0659f/attachment.sig>


More information about the U-Boot mailing list