From 7d0ec55f03cd448b588dfa463967b3b832dfb919 Mon Sep 17 00:00:00 2001 From: Tatsumi Hosokawa Date: Fri, 20 Mar 1998 04:49:19 +0000 Subject: [PATCH] Some parameter was left uninitialized when the card with incomplete "Version 1" CIS tupple is plugged after normal card. --- usr.sbin/pccard/pccardd/readcis.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pccard/pccardd/readcis.c b/usr.sbin/pccard/pccardd/readcis.c index d681aa9dbda..114b35e92f1 100644 --- a/usr.sbin/pccard/pccardd/readcis.c +++ b/usr.sbin/pccard/pccardd/readcis.c @@ -26,7 +26,7 @@ #ifndef lint static const char rcsid[] = - "$Id: readcis.c,v 1.10 1997/10/06 11:36:08 charnier Exp $"; + "$Id: readcis.c,v 1.11 1997/11/18 21:08:14 nate Exp $"; #endif /* not lint */ #include @@ -170,14 +170,19 @@ freecis(struct cis *cp) static void cis_info(struct cis *cp, unsigned char *p, int len) { + *cp->manuf = *cp->vers = *cp->add_info1 = *cp->add_info2 = '\0'; cp->maj_v = *p++; cp->min_v = *p++; + if (*p == 0xff) return; strncpy(cp->manuf, p, CIS_MAXSTR - 1); while (*p++); + if (*p == 0xff) return; strncpy(cp->vers, p, CIS_MAXSTR - 1); while (*p++); + if (*p == 0xff) return; strncpy(cp->add_info1, p, CIS_MAXSTR - 1); while (*p++); + if (*p == 0xff) return; strncpy(cp->add_info2, p, CIS_MAXSTR - 1); }