php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45355 DomDocument::schemaValidateSource causes an access violation
Submitted: 2008-06-25 14:16 UTC Modified: 2008-06-29 15:32 UTC
From: bghome at gmail dot com Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.2.6 OS: Windows XP SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bghome at gmail dot com
New email:
PHP Version: OS:

 

 [2008-06-25 14:16 UTC] bghome at gmail dot com
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-29 15:32 UTC] rrichards@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

This was fixed upstream in the libxml2 library
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 15:01:31 2024 UTC