util/nvmutil: check overflow in io_args

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-13 17:52:23 +00:00
parent e64b9b3e15
commit 5287a80a7e

View File

@@ -1761,6 +1761,9 @@ io_args(int fd, void *mem, size_t nrw,
if (off < 0 || off >= gbe_file_size)
goto err_io_args;
if ((off_t)(off + nrw) > gbe_file_size)
goto err_io_args;
if (nrw > GBE_PART_SIZE)
goto err_io_args;