diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-05-06 11:22:31 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-05-06 11:22:31 +0000 |
commit | dfadd0431d35b0fb267b2aa1f30edd2178bcd010 (patch) | |
tree | 4707eb961227380877f54685158cec8521cdda7a /sys/dev/pcmcia | |
parent | e9f5e58287e55382fa3afadfa3c9f6a1c092be21 (diff) |
range check for the CIS table scan
normally, the CIS table is scanned until we hit the end tuple (CISTPL_END). I
have at least one card with an invalid CIS table without end tuple - while
this card is in error, this should not bring us to ddb. thus stop scanning
when we reach PCMCIA_CIS_SIZE
ok millert@
Diffstat (limited to 'sys/dev/pcmcia')
-rw-r--r-- | sys/dev/pcmcia/pcmcia_cis.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/pcmcia/pcmcia_cis.c b/sys/dev/pcmcia/pcmcia_cis.c index fc32488cac8..65ebc8fcea7 100644 --- a/sys/dev/pcmcia/pcmcia_cis.c +++ b/sys/dev/pcmcia/pcmcia_cis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcmcia_cis.c,v 1.9 2002/11/19 18:36:18 jason Exp $ */ +/* $OpenBSD: pcmcia_cis.c,v 1.10 2003/05/06 11:22:30 henning Exp $ */ /* $NetBSD: pcmcia_cis.c,v 1.9 1998/08/22 23:41:48 msaitoh Exp $ */ /* @@ -155,8 +155,11 @@ pcmcia_scan_cis(dev, fct, arg) while (1) { while (1) { /* get the tuple code */ - - tuple.code = pcmcia_cis_read_1(&tuple, tuple.ptr); + if (tuple.ptr * tuple.mult < PCMCIA_CIS_SIZE) + tuple.code = pcmcia_cis_read_1(&tuple, + tuple.ptr); + else + tuple.code = PCMCIA_CISTPL_END; /* two special-case tuples */ |