diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-08 17:57:28 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-08 17:57:28 +0000 |
| commit | 3330f005fdd64ae671dbcff10b946d766aa2567f (patch) | |
| tree | dca9cf89e603858ce6446a118650e1f6e65cbcb5 | |
| parent | 5532a721f5cde7b1ac7b80a44e1ccbec2bb43d23 (diff) | |
util/nvmutil: validate ARG_PART and ARG_NOPART
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/nvmutil/nvmutil.c | 6 |
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 |
