After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 347708 - HTML chunked parsing failure when chunk ends "</"
HTML chunked parsing failure when chunk ends "</"
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2006-07-16 19:59 UTC by James Bursa
Modified: 2006-10-16 09:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test-case for htmlParseChunk (842 bytes, text/x-csrc)
2006-07-16 20:02 UTC, James Bursa
Details

Description James Bursa 2006-07-16 19:59:59 UTC
If a chunk passed to htmlParseChunk ends with "</" while parsing a script element,  the parser errors "HTML parser error : Invalid char in CDATA 0x0". The remainder of the document is then parsed incorrectly.

I think the problem is in htmlParseScript (the error above is from line 2711) but I don't know how to fix it.

I will attach a test-case showing this bug.

Thanks.
Comment 1 James Bursa 2006-07-16 20:02:43 UTC
Created attachment 69010 [details]
Test-case for htmlParseChunk
Comment 2 Daniel Veillard 2006-10-16 09:32:23 UTC
Okay, thanks to the test case I could reproduce and fix the bug relatively
easilly:

paphio:~/XML -> ./tst
htmlParseChunk 13 "<script>abc</"
htmlParseChunk 13 "script><p>def"
htmlParseChunk 5 "</p>"
htmlParseChunk 0
HTML DOCUMENT
standalone=true
  DTD(html), PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN, SYSTEM http://www.w3.org/TR/REC-html40/loose.dtd
  ELEMENT html
    ELEMENT head
      ELEMENT script
        CDATA_SECTION
          content=abc
    ELEMENT body
      ELEMENT p
        TEXT
          content=def
paphio:~/XML ->

  Fixed in CVS, thanks a lot for the detailed report !

Daniel