From bb60822446a64c0aa597dac00ecbbb006a7198f6 Mon Sep 17 00:00:00 2001 From: thorpej Date: Thu, 30 Jan 1997 03:32:56 +0000 Subject: [PATCH] Fix OBOB in ccdopen() partition range check. From Klaus Klein , PR #3161. --- 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 14df56f61432..83375e9478d9 100644 --- a/sys/dev/ccd.c +++ b/sys/dev/ccd.c @@ -1,4 +1,4 @@ -/* $NetBSD: ccd.c,v 1.36 1996/12/18 19:22:46 thorpej Exp $ */ +/* $NetBSD: ccd.c,v 1.37 1997/01/30 03:32:56 thorpej Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -560,7 +560,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;