tDOM

View Ticket
Login

View Ticket

Ticket Hash: 06f9c269e8ee8939a0ec1bd8a91eb4175accbdcb
Title: segfault in asHTML with CDATA section (patch)
Status: Closed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Resolution: Fixed
Last Modified: 2015-09-07 14:23:11
Version Found In: trunk
User Comments:
anonymous added on 2015-09-07 13:10:19:
Missing "return" before line 2652 of generic/tcldom.c (at the end of the block which handles CDATA_SECTION_NODE).

anonymous added on 2015-09-07 14:18:29: (text/x-fossil-plain)
The following script tickles the bug:

prior to [230278ccf5f3a4], this errors with "tcldom_AppendEscaped: can only handle UTF-8 chars up to 3 bytes length".

After [230278ccf5f3a4], output is "<html>data</html>".

Should this be "<html><![CDATA[data]]></html>", as emitted by [$dom asXML]?  I've no idea what the standards dictate here.


package require tdom

set dom [dom createDocument html]

set root [$dom documentElement]
$root appendChild [$dom createCDATASection "data"]
puts [$dom asHTML]

rolf added on 2015-09-07 14:23:11: (text/x-fossil-plain)
Observation and diagnostic are correct. Fixed by [230278ccf5]. Thanks.