diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-13 17:52:23 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-13 17:52:23 +0000 |
| commit | 5287a80a7efa5246e75c926f66482e149d7af0dd (patch) | |
| tree | 6f5f88ff18321e0cd2a07e9ae4baff7f84f9ff0b | |
| parent | e64b9b3e15fdfab3df22dfd38e203f6d4c298f4d (diff) | |
util/nvmutil: check overflow in io_args
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/nvmutil/nvmutil.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index f586e199..e5a21afc 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -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; |
