
2 Aug
2021
2 Aug
'21
9:21 p.m.
On Sun, 1 Aug 2021 at 16:23, Thomas Hebb tommyhebb@gmail.com 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@gmail.com
tools/mkimage.c | 6 ++++++ 1 file changed, 6 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org
(s/imput/input/ as you note)