summaryrefslogtreecommitdiff
path: root/sys/dev/cardbus/cardbus.c
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2005-09-12 17:16:49 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2005-09-12 17:16:49 +0000
commit81baa7094f29ba00a095b272db9f43058733601d (patch)
tree984dbf382d06d74d5ac4cc91e99e020173ad2ca9 /sys/dev/cardbus/cardbus.c
parent496d4f986a8bc1c63e3e6bdba8440514c1cbffc4 (diff)
better cis string parsing. from drochner@netbsd.org; tested by jmc@.
Diffstat (limited to 'sys/dev/cardbus/cardbus.c')
-rw-r--r--sys/dev/cardbus/cardbus.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c
index 4261442bf9a..fb0e5832def 100644
--- a/sys/dev/cardbus/cardbus.c
+++ b/sys/dev/cardbus/cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cardbus.c,v 1.25 2005/09/09 21:27:45 fgsch Exp $ */
+/* $OpenBSD: cardbus.c,v 1.26 2005/09/12 17:16:48 fgsch Exp $ */
/* $NetBSD: cardbus.c,v 1.24 2000/04/02 19:11:37 mycroft Exp $ */
/*
@@ -308,12 +308,13 @@ parse_tuple(u_int8_t *tuple, int len, void *data)
p = cis->cis1_info_buf + 2;
while (i <
sizeof(cis->cis1_info) / sizeof(cis->cis1_info[0])) {
+ if (p >= cis->cis1_info_buf + tuple[1] || *p == '\xff')
+ break;
cis->cis1_info[i++] = p;
while (*p != '\0' && *p != '\xff')
p++;
- if (*p == '\xff')
- break;
- p++;
+ if (*p == '\0')
+ p++;
}
break;
case PCMCIA_CISTPL_BAR: