|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-05-09 12:40 UTC] koenk82 at gmail dot com
Description:
------------
If you supply a non-existing file to xmlwriter_open_uri it produces an Out of memory error.
Reproduce code:
---------------
<?php
var_dump(xmlwriter_open_uri('foo/bar.tmp'));
?>
Expected result:
----------------
Warning: xmlwriter_open_uri(%s): failed to open stream: No such file or directory in %s on line %d
bool(false)
Actual result:
--------------
Warning: xmlwriter_open_uri(/home/koen/Bureaublad/php5/foo/bar.tmp): failed to open stream: No such file or directory in /home/koen/Bureaublad/mytests/xmlwriter_open_uri_error_003.php on line 2
Warning: xmlwriter_open_uri(): xmlNewTextWriterFilename : out of memory! in /home/koen/Bureaublad/mytests/xmlwriter_open_uri_error_003.php on line 2
bool(false)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
It's reproducible yet. $ sapi/cli/php -r 'xmlwriter_open_uri("file:///a");' Warning: xmlwriter_open_uri(/a): failed to open stream: Permission denied in Command line code on line 1 Warning: xmlwriter_open_uri(): xmlNewTextWriterFilename : out of memory! in Command line code on line 1Rob, can you take a look please? Maybe change the error in xmlNewTextWriterFilename from: out = xmlOutputBufferCreateFilename(uri, NULL, compression); if (out == NULL) { xmlWriterErrMsg(NULL, XML_ERR_NO_MEMORY, "xmlNewTextWriterFilename : out of memory!\n"); return NULL; } to out = xmlOutputBufferCreateFilename(uri, NULL, compression); if (out == NULL) { xmlWriterErrMsg(NULL, XML_EIO, "xmlNewTextWriterFilename : cannot create file %s\n", uri); return NULL; }