#38410 [Opn->Fbk]: PHP Interpreter Crash with schemaValidate on XML with CDATA sections.

From: Date: Thu, 10 Aug 2006 13:51:02 +0000
Subject: #38410 [Opn->Fbk]: PHP Interpreter Crash with schemaValidate on XML with CDATA sections.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-100648@lists.php.net to get a copy of this message
 ID:               38410
 Updated by:       tony2001@php.net
 Reported By:      adam at sccode dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Reproducible crash
 Operating System: Windows 2000/XP/2003
 PHP Version:      5.1.4
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

Cannot reproduce.


Previous Comments:
------------------------------------------------------------------------

[2006-08-10 11:14:28] adam at sccode dot com

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 this bug report at http://bugs.php.net/?id=38410&edit=1


Thread (6 messages)

« previous php.bugs (#100648) next »