summaryrefslogtreecommitdiff
path: root/main/streams/memory.c
diff options
context:
space:
mode:
authorNayana Hettiarachchi <nayana@ddproperty.com>2015-02-05 12:26:29 +0800
committerNayana Hettiarachchi <nayana@ddproperty.com>2015-02-05 12:26:29 +0800
commita3e07ff10c64f3c14a03be2335f2677b454f6558 (patch)
tree55ba2759a2370010f8b311e691a1998434ec7faf /main/streams/memory.c
parent067902daee9b293eec5b319c466d3f12fa643a27 (diff)
downloadphp-git-a3e07ff10c64f3c14a03be2335f2677b454f6558.tar.gz
#68986 bug fix
Diffstat (limited to 'main/streams/memory.c')
-rw-r--r--main/streams/memory.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/streams/memory.c b/main/streams/memory.c
index 02a44ddfc5..51ce12a06f 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;