summaryrefslogtreecommitdiff
path: root/util/nvmutil/nvmutil.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-15 00:02:56 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-15 00:02:56 +0000
commit0d5d8204e008a89a96654557d2a39563daa4580a (patch)
tree5156ba7f149f58f18b5dbfda8c0bee9eb62db86f /util/nvmutil/nvmutil.c
parent21bf1e644e8cd065a67ea14025fdfe5361e31ec3 (diff)
nvmutil: add missing check to io_args
accidentally removed this in a rebase Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
-rw-r--r--util/nvmutil/nvmutil.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index bea8ea2c..0003d9b2 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -2150,6 +2150,9 @@ io_args(int fd, void *mem, size_t nrw,
if (((size_t)off + nrw) < (size_t)off)
goto err_io_args;
+ if (rw_type > IO_PWRITE)
+ goto err_io_args;
+
return 0;
err_io_args: