com php-src: #68986 bug fix: main/streams/memory.c
| From: | Xinchen Hui | Date: | Thu, 05 Feb 2015 04:26:29 +0000 |
| Subject: | com php-src: #68986 bug fix: main/streams/memory.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84657@lists.php.net to get a copy of this message | ||
Commit: a3e07ff10c64f3c14a03be2335f2677b454f6558
Author: Nayana Hettiarachchi <nayana@ddproperty.com> Thu, 5 Feb 2015 12:26:29 +0800
Parents: 067902daee9b293eec5b319c466d3f12fa643a27
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a3e07ff10c64f3c14a03be2335f2677b454f6558
Log:
#68986 bug fix
Bugs:
https://bugs.php.net/68986
Changed paths:
M main/streams/memory.c
Diff:
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;