php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #68986
Patch fix.patch revision 2015-02-05 04:29 UTC by Nayana at ddproperty dot com

Patch fix.patch for Streams related Bug #68986

Patch version 2015-02-05 04:29 UTC

Return to Bug #68986 | Download this patch
Patch Revisions:

Developer: Nayana@ddproperty.com

diff --git a/main/streams/memory.c b/main/streams/memory.c
index 02a44dd..51ce12a 100644
--- a/main/streams/memory.c
+++ b/main/streams/memory.c
@@ -375,6 +375,10 @@ static size_t php_stream_temp_write(php_stream *stream, const char *buf, size_t
 
                if (memsize + count >= ts->smax) {
                        php_stream *file = php_stream_fopen_temporary_file(ts->tmpdir, "php", NULL);
+                       if (file == NULL) {
+                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create temporary file.  Check permissions in temporary files directory.");
+                               return NULL;
+                       }
                        php_stream_write(file, membuf, memsize);
                        php_stream_free_enclosed(ts->innerstream, PHP_STREAM_FREE_CLOSE);
                        ts->innerstream = file;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 07:01:31 2024 UTC