]> granicus.if.org Git - php/commitdiff
#68986 bug fix
authorNayana Hettiarachchi <nayana@ddproperty.com>
Thu, 5 Feb 2015 04:26:29 +0000 (12:26 +0800)
committerNayana Hettiarachchi <nayana@ddproperty.com>
Thu, 5 Feb 2015 04:26:29 +0000 (12:26 +0800)
main/streams/memory.c

index 02a44ddfc58a68e7cda4afaf8f5eb1176eb2062d..51ce12a06f19eb00855995cea6d17fa7eae20836 100644 (file)
@@ -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;