Date: Wed, 10 May 2000 14:40:46 +0900 (JST) From: "Daniel C. Sobral" <dcs@newsguy.com> To: imp@freebsd.org, iwasaki@freebsd.org, mobile@freebsd.org Subject: Bug on readcis.c r1.19 Message-ID: <200005100540.OAA00517@daniel.sobral>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200005100540.OAA00517>
