Date: Mon, 15 Mar 2004 16:10:04 -0800 (PST) From: Chris Pressey <cpressey@catseye.mine.nu> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/63405: make dumps core Message-ID: <200403160010.i2G0A4uJ002811@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/63405; it has been noted by GNATS. From: Chris Pressey <cpressey@catseye.mine.nu> To: freebsd-gnats-submit@FreeBSD.org, hsn@netmag.cz Cc: Subject: Re: bin/63405: make dumps core Date: Mon, 15 Mar 2004 16:06:48 -0800 This is a multi-part message in MIME format. --Multipart=_Mon__15_Mar_2004_16_06_48_-0800_K5uBXaHLgD87mT7a Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi, This problem is exhibited on FreeBSD 4.9 as well. It appears to stem from a NULL pointer dereference. Please review the attached patch. -Chris --Multipart=_Mon__15_Mar_2004_16_06_48_-0800_K5uBXaHLgD87mT7a Content-Type: text/plain; name="suff.c.diff" Content-Disposition: attachment; filename="suff.c.diff" Content-Transfer-Encoding: 7bit --- suff.c.orig Thu Mar 8 17:13:24 2001 +++ suff.c Mon Mar 15 16:02:16 2004 @@ -379,7 +379,12 @@ Lst l; Suff *s; { - LstNode ln = Lst_Member(l, (ClientData)s); + LstNode ln; + + if (s == NULL) + return; + + ln = Lst_Member(l, (ClientData)s); if (ln != NILLNODE) { Lst_Remove(l, ln); s->refCount--; @@ -683,12 +688,14 @@ * We'll be called twice when the next target is seen, but .c and .o * are only linked once... */ - SuffRemove(t->children, s); + if (t != NULL) + SuffRemove(t->children, s); /* * Remove the target from the source's parents list */ - SuffRemove(s->parents, t); + if (s != NULL) + SuffRemove(s->parents, t); } else if ((gn->type & OP_TRANSFORM) && DEBUG(SUFF)) { printf("transformation %s complete\n", gn->name); } --Multipart=_Mon__15_Mar_2004_16_06_48_-0800_K5uBXaHLgD87mT7a--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403160010.i2G0A4uJ002811>