summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/nvmutil/nvmutil.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index f86e88bf..0d9020ee 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -425,7 +425,7 @@ check_bounds(int c, int p)
{
if ((p != 0) && (p != 1))
err(SET_ERR(EINVAL), "check_bounds: invalid partnum %d", p);
- if ((c < 0) || (c > nf))
+ if ((c < 0) || (c > ((nf >> 1) - 1)))
err(SET_ERR(EINVAL), "check_bounds: out of bounds %d", c);
}