diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-12-23 09:17:20 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-12-23 09:17:20 +0000 |
commit | 45a5018aa6ee316a16f65f583d4b1a37b5cfe6f4 (patch) | |
tree | b23412d78cece27d68019a20f2d04352d653e1ca | |
parent | f5a35ae35dbcaf80410d1ae524484800008fe501 (diff) |
fix off by one in bounds test
ok deraadt@
-rw-r--r-- | usr.sbin/mksuncd/mksuncd.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 = |