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: Fri, 24 Mar 2000 11:45:35 -0600
To: <html-tidy@w3.org>
Message-ID: <OFBB5F6597.E3856060-ON8625686B.004E4F2A@rfdinc.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
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"

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 Friday, 24 March 2000 13:14:42 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:47 UTC