#45355 [NEW]: DomDocument::schemaValidateSource causes an access violation
| From: | bghome at gmail dot com | Date: | Wed, 25 Jun 2008 14:16:27 +0000 |
| Subject: | #45355 [NEW]: DomDocument::schemaValidateSource causes an access violation | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-126013@lists.php.net to get a copy of this message | ||
From: bghome at gmail dot com
Operating system: Windows XP SP2
PHP version: 5.2.6
PHP Bug Type: DOM XML related
Bug description: DomDocument::schemaValidateSource causes an access violation
Description:
------------
A specific error in the XML Schema (XSD) causes the DomDocument validator
to crash. The error occurs in the php5ts.dll.
Reproduce code:
---------------
<?php
$schema = <<<XSD
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element default="NEM" name="root">
<xs:simpleType>
<xs:restriction base="_valaszto">
<xs:enumeration value="IGEN" />
<xs:enumeration value="NEM" />
<xs:whiteSpace value="preserve" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:simpleType name="_valaszto">
<xs:restriction base="xs:string">
<xs:enumeration value="IGEN" />
<xs:enumeration value="NEM" />
<xs:whiteSpace value="collapse" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
XSD;
$xml = <<<XML
<root>
</root>
XML;
$dom = new DomDocument();
$dom->loadXML( $xml );
$dom->schemaValidateSource( $schema );
?>
Expected result:
----------------
Warning: DOMDocument::schemaValidateSource()
[domdocument.schemavalidatesource]: Invalid Schema in
C:\wwwroot\ingatlanok2_trunk\validator.php on line 32
Actual result:
--------------
The httpd.exe crashes.
--
Edit bug report at http://bugs.php.net/?id=45355&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45355&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45355&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45355&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45355&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45355&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45355&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45355&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45355&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45355&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45355&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45355&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45355&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45355&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45355&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45355&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45355&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45355&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45355&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45355&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45355&r=mysqlcfg