util/nvmutil: add negative off check to prw

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-13 23:22:21 +00:00
parent fb57cedded
commit e71f977468
+1
View File
@@ -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)