#34952 [Fbk->Opn]: double free when passing node from external document() to a PHP function
| From: | theo at crazygreek dot co dot uk | Date: | Fri, 21 Oct 2005 21:20:51 +0000 |
| Subject: | #34952 [Fbk->Opn]: double free when passing node from external document() to a PHP function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-86906@lists.php.net to get a copy of this message | ||
ID: 34952
User updated by: theo at crazygreek dot co dot uk
Reported By: theo at crazygreek dot co dot uk
-Status: Feedback
+Status: Open
Bug Type: XSLT related
Operating System: Linux
PHP Version: 5.0.5
New Comment:
I'm afraid I don't have the time to keep a seperate server running with
latest PHP on.
As it happens, a colleauge happens to have a cvs version installed and
i've asked him to test and report findings here.
As a note, if he didn't have a copy installed, my reponse would still
have been just the first paragraph of this comment. I'm a developer,
not a quality assurance tester, and i do not expect to have to
constantly keep latest CVS compiled somewhere just so i can test
something every time PHP crashes.
Previous Comments:
------------------------------------------------------------------------
[2005-10-21 22:59:07] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2005-10-21 22:57:48] theo at crazygreek dot co dot uk
Description:
------------
Performing a PHP callback from within an XSLT template with a parameter
of an element that is inside a external XML document causes a double
free, followed by crash. Running latest stable PHP.
Reproduce code:
---------------
=========
crash.php
=========
$xslt = new XsltProcessor();
$xslt->registerPHPFunctions();
$xslt->importStyleSheet(DOMDocument::load('test.xsl'));
echo $xslt->transformToDoc(new DOMDocument())->saveXml();
function crashMe() {
return null;
}
=========
crash.xsl
=========
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:php="http://php.net/xsl"
version="1.0">
<xsl:template match="/">
<xsl:copy-of select="php:function('crashMe',
document('crash.xml'))"/>
</xsl:template>
</xsl:stylesheet>
=========
crash.xml
=========
<?xml version="1.0"?>
<crashed/>
Expected result:
----------------
Just the following:
<?xml version="1.0"?>
Actual result:
--------------
A crash!
*** glibc detected *** double free or corruption (fasttop): 0x085d8540
***
Aborted
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34952&edit=1