diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-07-07 03:02:52 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-07-07 03:02:52 +0000 |
commit | b6f917e38f32ad82988462d315c2cc55cf1bf038 (patch) | |
tree | 5cdca187b9174c4ca42772ef5bc06e07679f4f92 /sys/arch/atari | |
parent | 0718e94007d14d484b2502651a72956542b4a5e0 (diff) |
fix chrtoblk() so that it returne ENODEV for entries beyond the end of the table
Diffstat (limited to 'sys/arch/atari')
-rw-r--r-- | sys/arch/atari/atari/conf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/atari/atari/conf.c b/sys/arch/atari/atari/conf.c index 692c36a5630..f982504898c 100644 --- a/sys/arch/atari/atari/conf.c +++ b/sys/arch/atari/atari/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.10 1997/11/23 05:21:54 mickey Exp $ */ +/* $OpenBSD: conf.c,v 1.11 1998/07/07 03:02:35 deraadt Exp $ */ /* * Copyright (c) 1991 The Regents of the University of California. @@ -259,7 +259,6 @@ static int chrtoblktab[] = { /* 25 */ NODEV, /* 26 */ NODEV, /* 27 */ 13, - /* 28 */ NODEV, }; /* @@ -271,11 +270,12 @@ chrtoblk(dev) { int blkmaj; - if (major(dev) >= nchrdev) - return(NODEV); - blkmaj = chrtoblktab[major(dev)]; + if (major(dev) >= MAXDEV || + major(dev) > sizeof(chrtoblktbl)/sizeof(chrtoblktbl[0])) + return (NODEV); + blkmaj = chrtoblktbl[major(dev)]; if (blkmaj == NODEV) - return(NODEV); + return (NODEV); return (makedev(blkmaj, minor(dev))); } |