summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-07-04 05:12:59 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-07-04 05:12:59 +0000
commit31278c14d6e1497b4cd36ffcdf1e92d03d24a8ed (patch)
tree3dca74ba2f324087e258f49aaac40eda68fa2288 /sys
parentf9f979589de9669fb6bc74fff6457a84dc5262e8 (diff)
Fix off-by-one error in unit checking
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/vax/mscp/mscp_disk.c6
-rw-r--r--sys/arch/vax/mscp/mscp_tape.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/vax/mscp/mscp_disk.c b/sys/arch/vax/mscp/mscp_disk.c
index 6c61963e064..ae0b4eb2a44 100644
--- a/sys/arch/vax/mscp/mscp_disk.c
+++ b/sys/arch/vax/mscp/mscp_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mscp_disk.c,v 1.7 2000/04/27 03:14:46 bjc Exp $ */
+/* $OpenBSD: mscp_disk.c,v 1.8 2001/07/04 05:12:57 csapuntz Exp $ */
/* $NetBSD: mscp_disk.c,v 1.21 1999/06/06 19:16:18 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -317,7 +317,7 @@ rastrategy(bp)
* Make sure this is a reasonable drive to use.
*/
unit = DISKUNIT(bp->b_dev);
- if (unit > ra_cd.cd_ndevs || (ra = ra_cd.cd_devs[unit]) == NULL) {
+ if (unit >= ra_cd.cd_ndevs || (ra = ra_cd.cd_devs[unit]) == NULL) {
bp->b_error = ENXIO;
bp->b_flags |= B_ERROR;
goto done;
@@ -685,7 +685,7 @@ rxstrategy(bp)
* Make sure this is a reasonable drive to use.
*/
unit = DISKUNIT(bp->b_dev);
- if (unit > rx_cd.cd_ndevs || (rx = rx_cd.cd_devs[unit]) == NULL) {
+ if (unit >= rx_cd.cd_ndevs || (rx = rx_cd.cd_devs[unit]) == NULL) {
bp->b_error = ENXIO;
bp->b_flags |= B_ERROR;
goto done;
diff --git a/sys/arch/vax/mscp/mscp_tape.c b/sys/arch/vax/mscp/mscp_tape.c
index 49f53e1df12..d08d21495ff 100644
--- a/sys/arch/vax/mscp/mscp_tape.c
+++ b/sys/arch/vax/mscp/mscp_tape.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mscp_tape.c,v 1.4 2000/04/27 03:14:46 bjc Exp $ */
+/* $OpenBSD: mscp_tape.c,v 1.5 2001/07/04 05:12:58 csapuntz Exp $ */
/* $NetBSD: mscp_tape.c,v 1.14 1999/06/06 19:16:18 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -260,7 +260,7 @@ mtstrategy(bp)
* Make sure this is a reasonable drive to use.
*/
unit = mtunit(bp->b_dev);
- if (unit > mt_cd.cd_ndevs || (mt = mt_cd.cd_devs[unit]) == NULL) {
+ if (unit >= mt_cd.cd_ndevs || (mt = mt_cd.cd_devs[unit]) == NULL) {
bp->b_error = ENXIO;
goto bad;
}