#48221 [NEW]: memory leak when passing invalid xslt parameter
| From: | cweiske@php.net | Date: | Sun, 10 May 2009 13:43:12 +0000 |
| Subject: | #48221 [NEW]: memory leak when passing invalid xslt parameter | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-137104@lists.php.net to get a copy of this message | ||
From: cweiske@php.net
Operating system: Linux
PHP version: 5.3.0RC2
PHP Bug Type: XSLT related
Bug description: memory leak when passing invalid xslt parameter
Description:
------------
One is able to pass invalid parameters to XSLTProcessor::setParameter. In
this case, not all memory gets freed in
ext/xsl/xsltprocessor.c::php_xsl_xslt_make_params since the values don't
get filled and the array seems to be empty (NULL values).
Reproduce code:
---------------
--TEST--
Check xsltprocessor::setparameter error handling with both single and
double quotes
--SKIPIF--
<?php
if (!extension_loaded('xsl')) {
die("skip\n");
}
?>
--FILE--
<?php
include('prepare.inc');
$proc->importStylesheet($xsl);
$proc->setParameter('', '', '"\'');
$proc->transformToXml($dom);
--EXPECTF--
Warning: XSLTProcessor::transformToXml(): Cannot create XPath expression
(string contains both
--CREDITS--
Christian Weiske, cweiske@php.net
PHP Testfest Berlin 2009-05-09
Actual result:
--------------
[Sun May 10 15:20:40 2009] Script:
'/home/cweiske/Dev/cvs/php/testfest/tests/xsl/php_xsl_xslt_string_to_xpathexpr.php'
/home/cweiske/Dev/cvs/php/php-5.3.0RC2/Zend/zend_hash.c(1118) : Freeing
0x0188D558 (1 bytes),
script=/home/cweiske/Dev/cvs/php/testfest/tests/xsl/php_xsl_xslt_string_to_xpathexpr.php
=== Total 1 memory leaks detected ===
--
Edit bug report at http://bugs.php.net/?id=48221&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48221&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48221&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48221&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=48221&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48221&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=48221&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=48221&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=48221&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=48221&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=48221&r=support
Expected behavior: http://bugs.php.net/fix.php?id=48221&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=48221&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=48221&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=48221&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48221&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48221&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=48221&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=48221&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=48221&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=48221&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=48221&r=mysqlcfg