From 329304b72ae957c879e1f6e05e15fe0ebb0ed269 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 31 Jan 1997 10:32:21 +0000 Subject: [PATCH] off-by-one in partition indexing, netbsd pr#3161, kleink@layla.inka.de --- sys/dev/ccd.c | 4 ++-- 1 file 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; -- 2.20.1