summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-08 17:57:28 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-08 17:57:28 +0000
commit3330f005fdd64ae671dbcff10b946d766aa2567f (patch)
treedca9cf89e603858ce6446a118650e1f6e65cbcb5 /util/nvmutil
parent5532a721f5cde7b1ac7b80a44e1ccbec2bb43d23 (diff)
util/nvmutil: validate ARG_PART and ARG_NOPART
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index c5bd2d6d..006a0a21 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -414,6 +414,12 @@ sanitize_command_index(size_t c)
if (command[c].arg_part > 1)
err(ECANCELED, "cmd index %zu: arg_part above 1", c);
+
+ if (ARG_NOPART)
+ err(ECANCELED, "ARG_NOPART is non-zero");
+
+ if (ARG_PART != 1)
+ err(ECANCELED, "ARG_PART is a value other than one");
}
static void