|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8363 XML parser dies if character_data_handler set
Submitted: 2000-12-21 14:46 UTC Modified: 2000-12-23 16:48 UTC
From: bill at rsv dot ricoh dot com Assigned:
Status: Closed Package: XML related
PHP Version: 4.0.4 OS: RH Linux 6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: bill at rsv dot ricoh dot com
New email:
PHP Version: OS:


 [2000-12-21 14:46 UTC] bill at rsv dot ricoh dot com
The following test case originally came from the online docs, but most recently from the xml2tree project I wrote ( );  two people have reported it broken with the release of 4.0.4.

----------- configuration -----------------
./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs

----------- test case ---------
 function characterData($parser, $data)
      echo "in characterData got [$data]<br>";

    $xml_parser = xml_parser_create();

    // commment out the following line to prevent the crash
    xml_set_character_data_handler($xml_parser, "characterData"); 

    $xmlContent = "<mytag> <othertag> goo </othertag><yuck>glumph</yuck></mytag>";

    echo "before data<br>"; flush();  

    // 4.0.4 dies here, but only if character_data_handler is set;
    // 4.0.3 is fine.
    if (!xml_parse($xml_parser, $xmlContent, "yes" )) { 
      die(sprintf("XML error: %s at line %d",
    echo "after  data<br>"; flush();


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-23 16:48 UTC]
fixed in CVS
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon May 29 11:03:43 2023 UTC