W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2000

Crash due to null pointer in ReportAttrError

From: Gene Schroeder <erschroeder@lucent.com>
Date: Wed, 19 Jan 2000 09:12:24 -0500
To: <html-tidy@w3.org>
Message-ID: <001901bf6287$35a906c0$06090787@h235.cb.lucent.com>
Having just discovered, downloaded, built, and used tidy in the last day,
this might be a known problem, but I didn't see it on the archive.

With my first HTML file, tidy unfortunately crashed.  I took a quick look
with a debugger, and found that it was trying to report an attr error, but
the value pointer was 0.  So for a quck fix I add the following near the top
of ReportAttrError.

if (attr == 0)
{
	attr = "(nil)";
}

This prevents the crash.  The line it chokes on is:

<IMG SRC="/images/tagline.gif" WIDTH="210 HEIGHT="25" BORDER="0"
ALIGN="MIDDLE">&nbsp;

By adding atheclosing " on WIDTH, the problem goes away, but as this is
"legitimate" bad HTML, tidy should gracefully deal with it.  The solution
above might not be the proper one, but at least allows tidy to continue
working, and is good insurance in case there are other scenarios that could
lead to this.

The version I was using is, I believe, the latest (13 January).  I am on
Solaris 2.5.1; I think some run-time-libraries check for null pointers in
this case (%s arguments in printf-like functions), but apparently Solaris
takes the traditional "you asked for it, you got it" approach.

Gene Schroeder
Lucent Technologies
Received on Wednesday, 19 January 2000 09:10:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:43 GMT