From: adam at sccode dot com Operating system: Windows 2000/XP/2003 PHP version: 5.1.4 PHP Bug Type: Reproducible crash Bug description: PHP Interpreter Crash with schemaValidate on XML with CDATA sections.
Description: ------------ Attempting to validate an XML document against a schema containing a CDATA section with whitespace preceeding the opening tag causes the PHP Interpreter to crash with an exception in Windows 2000/XP and 2003 on both IIS and Apache. Example: <?xml version="1.0"?> <test xmlns="http://www.php.net/bugtests"> <value> <![CDATA[ test ]]> </value> </test> Validating the schema using xmllint with libxml 2.6.22 DLL works as expected and does not crash. I found a similar, possibly the same bug (http://bugs.php.net/bug.php?id=37435&edit=2) which has been closed. As I could not reproduce it with xmllint, I figure that it must be the PHP interpreter. Reproduce code: --------------- crash-test.php: <?php $xml = new DOMDocument('1.0'); $xml->load('crash-test.xml'); $xml->schemaValidate('crash-test.xsd'); // crash here ?> crash-test.xml: <?xml version="1.0"?> <test xmlns="http://www.php.net/bugtests"> <value> <![CDATA[ test ]]> </value> </test> crash-test.xsd: <?xml version="1.0" encoding="UTF-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.php.net/bugtests" xmlns="http://www.php.net/bugtests" elementFormDefault="qualified"> <xs:element name="test"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="value" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> Expected result: ---------------- validated schema Actual result: -------------- php interpreter crashes with exception -- Edit bug report at http://bugs.php.net/?id=38410&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38410&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38410&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38410&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38410&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38410&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38410&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38410&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38410&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38410&r=support Expected behavior: http://bugs.php.net/fix.php?id=38410&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38410&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38410&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38410&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38410&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38410&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38410&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38410&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38410&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38410&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38410&r=mysqlcfg