From owner-freebsd-mobile Tue May 9 22:39:21 2000 Delivered-To: freebsd-mobile@freebsd.org Received: from peach.ocn.ne.jp (peach.ocn.ne.jp [210.145.254.87]) by hub.freebsd.org (Postfix) with ESMTP id C017537B72B; Tue, 9 May 2000 22:39:16 -0700 (PDT) (envelope-from dcs@newsguy.com) Received: from daniel.sobral (p36-dn01kiryunisiki.gunma.ocn.ne.jp [211.0.245.37]) by peach.ocn.ne.jp (8.9.1a/OCN/) with ESMTP id OAA08538; Wed, 10 May 2000 14:39:14 +0900 (JST) Received: (from dcs@localhost) by daniel.sobral (8.9.3/8.9.3) id OAA00517; Wed, 10 May 2000 14:40:46 +0900 (JST) (envelope-from dcs) From: "Daniel C. Sobral" Message-Id: <200005100540.OAA00517@daniel.sobral> Subject: Bug on readcis.c r1.19 To: imp@freebsd.org, iwasaki@freebsd.org, mobile@freebsd.org Date: Wed, 10 May 2000 14:40:46 +0900 (JST) Disclaimer: Klaatu Barada Nikto! X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org My pccardd has been core dumping since my last upgrade. I think the following change (revision 1.19 or readcis.c) is the responsible: @@ -194,45 +175,19 @@ 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++; - len -= 2; - if (cp->manuf) { - free(cp->manuf); - cp->manuf = NULL; - } - if (len > 1 && *p != 0xff) { - cp->manuf = strdup(p); - while (*p++ && --len > 0); - } [etc] Notice that in the previous case cp->manuf was always allocated, while it can be a NULL pointer in the present version. This seems to happen in my case, for instance (APA 1480 Cardbus present), resulting in a segment violation from a strcmp called from around line 238 in cardd.c (card_insert()). Yo! Someone! Fix it! :-) For now, I'll add a NULL pointer guard in my version... -- Daniel C. Sobral (8-DCS) dcs@newsguy.com dcs@freebsd.org capo@there.is.no.bsdconspiracy.net Did you hear that there's a group of South American Indians that worship the number zero? Is nothing sacred? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message