From 45a5018aa6ee316a16f65f583d4b1a37b5cfe6f4 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Thu, 23 Dec 2021 09:17:20 +0000 Subject: fix off by one in bounds test ok deraadt@ --- usr.sbin/mksuncd/mksuncd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/mksuncd/mksuncd.c b/usr.sbin/mksuncd/mksuncd.c index cd1114c0ed9..83645300588 100644 --- a/usr.sbin/mksuncd/mksuncd.c +++ b/usr.sbin/mksuncd/mksuncd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mksuncd.c,v 1.4 2019/06/28 13:32:48 deraadt Exp $ */ +/* $OpenBSD: mksuncd.c,v 1.5 2021/12/23 09:17:19 jsg Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -264,7 +264,7 @@ adjust_label(int f, struct sun_disklabel *slp, int part, off_t start, off_t size if (start > 65535) errx(1, "start too large! %lld", (long long)start); - if (part < 0 || part > 8) + if (part < 0 || part >= 8) errx(1, "invalid partition: %d", part); slp->sl_part[part].sdkp_cyloffset = start; slp->sl_part[part].sdkp_nsectors = -- cgit v1.2.3