mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-25 13:29:03 +02:00
util/nvmutil: add negative off check to prw
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -1684,6 +1684,7 @@ prw(int fd, void *mem, size_t nrw,
|
||||
goto err_prw;
|
||||
|
||||
if (fd < 0
|
||||
|| off < 0
|
||||
|| !nrw /* prevent zero read request */
|
||||
|| nrw > (size_t)SSIZE_MAX /* prevent overflow */
|
||||
|| (unsigned int)rw_type > IO_PWRITE)
|
||||
|
||||
Reference in New Issue
Block a user