Re: 7-Jul-99 bug: Possible bad pointer when moving <b> inside of <li>

At 6:26 PM -0600 7/22/99, Randy Waki wrote:
>Thanks for Tidy!  It's proving invaluable.
>
>I have some apparent bugs to report (in this and subsequent messages).
>
>The HTML document below has a <b> outside of an <li> rather than inside it.
>I think this is causing 7-Jul-99 Tidy to dereference a bad pointer in
>istack.c, InsertedToken(), line 235:
>
>    istack = lexer->insert;
>
>Symptoms seem to vary depending on the contents of memory.  One (much
>longer) incarnation of this example document caused Tidy to generate the
>invalid start tag "<\0x18\0x0d\0x0a\0x30>" along with the corresponding end
>tag.  Also, Andy Quick's 7-Jul-99 Java Tidy throws an
>ArrayIndexOutOfBoundsException every time (which is what leads me to suspect
>the above mentioned line).
>
>-------- Example HTML document --------
><html>
>  <head>
>    <title>x</title>
>  </head>
>  <body>
>    <ul>
>      <li>item 1</li>
>      <b><li>item 2</li></b>
>    </ul>
>  </body>
></html>
>---------------------------------------

I can confirm on another platform (Mac OS) that there is a bug here (still
in the 26th July 99 version). In my case, it appears that infinite
recursion is probably occurring, and would have likely crashed had I not
stopped it. I was getting the following error output on the above test case
:

Tidy (vers 26th July 1999) Parsing "<b> inside <li>.html"
line 8 column 7 - Warning: missing <li>
line 8 column 10 - Warning: missing </b> before <li>
line 8 column 10 - Warning: trimming empty <b>
line 8 column 10 - Warning: trimming empty <li>
line 8 column 14 - Warning: inserting implicit <b>
line 8 column 25 - Warning: discarding unexpected </b>
line 8 column 25 - Warning: discarding unexpected </b>
line 8 column 25 - Warning: discarding unexpected </b>
... ad infinitum ...

I haven't done any debugging on it yet.

Regards, Terry

Received on Saturday, 31 July 1999 23:24:21 UTC