summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1997-01-31 10:32:21 +0000
committerderaadt <deraadt@openbsd.org>1997-01-31 10:32:21 +0000
commit329304b72ae957c879e1f6e05e15fe0ebb0ed269 (patch)
tree2ac1648a7a1fbf2b68c2966a04940b14696e2cd0
parentif error, b_resid = b_bcount (diff)
downloadwireguard-openbsd-329304b72ae957c879e1f6e05e15fe0ebb0ed269.tar.xz
wireguard-openbsd-329304b72ae957c879e1f6e05e15fe0ebb0ed269.zip
off-by-one in partition indexing, netbsd pr#3161, kleink@layla.inka.de
-rw-r--r--sys/dev/ccd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c
index 0dd31541ff5..94bed785260 100644
--- a/sys/dev/ccd.c
+++ b/sys/dev/ccd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccd.c,v 1.14 1997/01/31 10:31:43 deraadt Exp $ */
+/* $OpenBSD: ccd.c,v 1.15 1997/01/31 10:32:21 deraadt Exp $ */
/* $NetBSD: ccd.c,v 1.33 1996/05/05 04:21:14 thorpej Exp $ */
/*-
@@ -561,7 +561,7 @@ ccdopen(dev, flags, fmt, p)
/* Check that the partition exists. */
if (part != RAW_PART) {
if (((cs->sc_flags & CCDF_INITED) == 0) ||
- ((part > lp->d_npartitions) ||
+ ((part >= lp->d_npartitions) ||
(lp->d_partitions[part].p_fstype == FS_UNUSED))) {
error = ENXIO;
goto done;