Bug #13364: PHP crashes when CDATA is used in a <!ATTLIST > tag
| From: | toface at nicetomeetyou dot to | Date: | Tue, 18 Sep 2001 12:34:12 +0000 |
| Subject: | Bug #13364: PHP crashes when CDATA is used in a <!ATTLIST > tag | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-66183@lists.php.net to get a copy of this message | ||
From: toface@nicetomeetyou.to
Operating system: Debian x86 unstable
PHP version: 4.0.6
PHP Bug Type: DOM XML related
Bug description: PHP crashes when CDATA is used in a <!ATTLIST > tag
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 bug report at: http://bugs.php.net/?id=13364&edit=1