ID: 13364
Updated by: mfischer
Reported By: [EMAIL PROTECTED]
Old Summary: PHP crashes when CDATA is used in a <!ATTLIST > tag
Status: Open
Old Bug Type: DOM XML related
Bug Type: Feature/Change Request
Operating System: Debian x86 unstable
PHP Version: 4.0.6
Old Assigned To:
Assigned To: mfischer
New Comment:
Fix for crash is coming, but yet this is a feature request to support ATTLIST.
Assigned to me.
Previous Comments:
------------------------------------------------------------------------
[2001-09-18 08:47:01] [EMAIL PROTECTED]
Program received signal SIGSEGV, Segmentation fault.
node_list_wrapper_dtor (node=0x82f5b80) at php_domxml.c:315
warning: Source file is more recent than executable.
315 if (!node || node->type == XML_DTD_NODE)
(gdb) bt
#0 node_list_wrapper_dtor (node=0x82f5b80) at php_domxml.c:315
#1 0x809ce58 in php_free_xml_doc (rsrc=0x8301a4c) at php_domxml.c:337
#2 0x81425aa in list_entry_destructor (ptr=0x8301a4c) at zend_list.c:177
#3 0x8142706 in zend_destroy_rsrc_list (ht=0x820ba9c) at zend_list.c:248
#4 0x8136b68 in shutdown_executor () at zend_execute_API.c:190
#5 0x813da12 in zend_deactivate () at zend.c:595
#6 0x8091f18 in php_request_shutdown (dummy=0x0) at main.c:736
#7 0x8145a26 in apache_php_module_main (r=0x82c5034, display_source_mode=0)
at sapi_apache.c:96
#8 0x8090356 in send_php ()
#9 0x80903af in send_parsed_php ()
#10 0x81619f3 in ap_invoke_handler ()
#11 0x8175539 in process_request_internal ()
#12 0x817559c in ap_process_request ()
#13 0x816cb6e in child_main ()
------------------------------------------------------------------------
[2001-09-18 08:34:12] [EMAIL PROTECTED]
tested with 4.0.7rc2
when CDATA is used in a ATTLIST tag, php crashes while trying to parse it into a
xmltree or xmldocfile.
XML file:
<?xml version='1.0' standalone="yes"?>
<!DOCTYPE attackList [
<!ELEMENT attack (host, port, attacks, date)>
<!ELEMENT host EMPTY>
<!ATTLIST host addr ID #REQUIRED>
<!ATTLIST host addr CDATA #REQUIRED>
<!ATTLIST host name CDATA #IMPLIED>
<!ELEMENT port EMPTY>
<!ATTLIST port portid ENTITY #REQUIRED>
<!ATTLIST port protocol (tcp | udp | icmp) #REQUIRED>
<!ELEMENT attacks EMPTY>
<!ATTLIST attacks number ENTITY #REQUIRED>
<!ELEMENT date EMPTY>
<!ATTLIST date seconds ENTITY #REQUIRED>
]>
<attackList>
<attack>
<host addr="213.67.44.26" name="h26n2fls31o981.telia.com" />
<port portid="137" protocol="udp" />
<attacks number="6" />
<date seconds="999160369" />
</attack>
</attackList>
Script:
$fd = fopen($file,"r");
$myXML = fread($fd,filesize($file));
fclose($fd);
$docTree = xmltree($myXML);
gdb backtrace using apache and static php 4.0.6 will be here "real soon now"(tm)
(probably today though)
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13364&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]