ID: 37853
Updated by: tony2001@php.net
Reported By: jona at oismail dot com
-Status: Open
+Status: Feedback
Bug Type: Reproducible crash
Operating System: Windows 2000
PHP Version: 5.1.4
New Comment:
We still need the backtrace, though.
Previous Comments:
------------------------------------------------------------------------
[2006-06-19 21:48:33] jona at oismail dot com
The issue is likely specific to Windows / IIS / sapi / isapi then?
Can't seem to make the CGI version work on IIS or I'd test if it was
sapi specific.
Sorry.... :-(
------------------------------------------------------------------------
[2006-06-19 21:38:40] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php
for Win32
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
No ISAPI or windows here, only Linux.
------------------------------------------------------------------------
[2006-06-19 21:36:07] jona at oismail dot com
I get an "PHP has encountered an Access Violation at 01B1B9F3" for both
v5.1.4 and v5.2-dev.
Are you running PHP as an ISAPI module?
------------------------------------------------------------------------
[2006-06-19 21:28:55] tony2001@php.net
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
I get two error messages and no crash:
Warning: DOMDocument::loadXML(): xmlParseEntityRef: no name in Entity,
line: 3 in /tmp/3.php on line 27
Warning: DOMDocument::schemaValidateSource(): The document has no
document element. in /tmp/3.php on line 29
------------------------------------------------------------------------
[2006-06-19 20:46:07] jona at oismail dot com
Description:
------------
When an unescaped & is encounted in an XML document, PHP causes an
access violation in IIS when DOM schemaValidate or DOM
schemaValidateSource is called.
I have PHP running as an ISAPI module using the php5isapi.dll
Reproduce code:
---------------
<?php
$sXML = '<?xml version="1.0" encoding="ISO-8859-5"?>
<root type="input"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="input.xsd">
<username>Jona&</username>
</root>';
$sSchema = '<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:simpleType name="string">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
</xs:restriction>
</xs:simpleType>
<xs:element name="root">
<xs:complexType>
<xs:choice>
<xs:element name="username" type="string" />
<xs:element name="password" type="string" />
</xs:choice>
<xs:attribute name="type" type="xs:string" use="required"
fixed="input" />
</xs:complexType>
</xs:element>
</xs:schema>';
$obj_DOM = new DOMDocument("1.0", "ISO-8859-5");
$obj_DOM->loadXML(trim($sXML) );
$obj_DOM->schemaValidateSource($sSchema);
?>
Expected result:
----------------
Warning thrown along the lines of "Invalid XML document" or
schemaValidate returns false.
Actual result:
--------------
PHP has encountered an Access Violation at 01B1E093
Warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]:
xmlParseEntityRef: no name in Entity, line: 3 in
D:\www\php5api\webroot\xml_schema_test.php on line 27
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37853&edit=1