diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-12-16 21:47:50 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2000-12-16 21:47:50 +0000 |
commit | 84c9005b8045d0cbebb8ec713468a9fa06a7b34f (patch) | |
tree | 691fadcc88a833667c3a9cfd04238a966626f099 | |
parent | 33f9ed3482ca07b36b181d04e309c48a3cfab131 (diff) |
make sure cis1_info[i] is not NULL before strcmp() w/ it; fixes some obscure panics
-rw-r--r-- | sys/dev/pcmcia/com_pcmcia.c | 7 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_ne_pcmcia.c | 3 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_rln_pcmcia.c | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/pcmcia/com_pcmcia.c b/sys/dev/pcmcia/com_pcmcia.c index 9b2236c0b64..a2928e0fec4 100644 --- a/sys/dev/pcmcia/com_pcmcia.c +++ b/sys/dev/pcmcia/com_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com_pcmcia.c,v 1.26 2000/04/24 19:43:35 niklas Exp $ */ +/* $OpenBSD: com_pcmcia.c,v 1.27 2000/12/16 21:47:48 mickey Exp $ */ /* $NetBSD: com_pcmcia.c,v 1.15 1998/08/22 17:47:58 msaitoh Exp $ */ /* @@ -225,8 +225,9 @@ com_pcmcia_match(parent, match, aux) i++) { for (j = 0; j < 4; j++) if (com_pcmcia_prod[i].cis1_info[j] && - strcmp(com_pcmcia_prod[i].cis1_info[j], - pa->card->cis1_info[j])) + pa->card->cis1_info[j] && + strcmp(pa->card->cis1_info[j], + com_pcmcia_prod[i].cis1_info[j])) break; if (j == 4) return 1; diff --git a/sys/dev/pcmcia/if_ne_pcmcia.c b/sys/dev/pcmcia/if_ne_pcmcia.c index 7faf4310644..da3720f058b 100644 --- a/sys/dev/pcmcia/if_ne_pcmcia.c +++ b/sys/dev/pcmcia/if_ne_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ne_pcmcia.c,v 1.31 2000/08/30 20:51:35 fgsch Exp $ */ +/* $OpenBSD: if_ne_pcmcia.c,v 1.32 2000/12/16 21:47:49 mickey Exp $ */ /* $NetBSD: if_ne_pcmcia.c,v 1.17 1998/08/15 19:00:04 thorpej Exp $ */ /* @@ -401,6 +401,7 @@ struct ne2000dev { ((card)->product != PCMCIA_PRODUCT_INVALID) && \ ((card)->product == ne2000devs[(n)].product)) || \ ((ne2000devs[(n)].cis_info[0]) && (ne2000devs[(n)].cis_info[1]) && \ + ((card)->cis1_info[0]) && ((card)->cis1_info[1]) && \ (strcmp((card)->cis1_info[0], ne2000devs[(n)].cis_info[0]) == 0) && \ (strcmp((card)->cis1_info[1], ne2000devs[(n)].cis_info[1]) == 0))) && \ ((fct) == ne2000devs[(n)].function))? \ diff --git a/sys/dev/pcmcia/if_rln_pcmcia.c b/sys/dev/pcmcia/if_rln_pcmcia.c index 99b634ec6b3..5c90087c1bd 100644 --- a/sys/dev/pcmcia/if_rln_pcmcia.c +++ b/sys/dev/pcmcia/if_rln_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rln_pcmcia.c,v 1.10 2000/04/24 19:43:36 niklas Exp $ */ +/* $OpenBSD: if_rln_pcmcia.c,v 1.11 2000/12/16 21:47:49 mickey Exp $ */ /* * David Leonard <d@openbsd.org>, 1999. Public domain. * @@ -107,7 +107,8 @@ rln_pcmcia_product_lookup(pa) for (j = 0; j < 4; j++) { if (rpp->cis[j] == NULL) return rpp; - if (strcmp(pa->card->cis1_info[j], rpp->cis[j]) != 0) + if (pa->card->cis1_info[j] && + strcmp(pa->card->cis1_info[j], rpp->cis[j]) != 0) break; } if (j == 4) |