mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.1'
* PHP-7.1: #74337 pointer returned by php_stream_fopen_tmpfile not validated in memory.c
This commit is contained in:
commit
bbe2a13395
1 changed files with 6 additions and 1 deletions
|
@ -489,9 +489,14 @@ static int php_stream_temp_cast(php_stream *stream, int castas, void **ret)
|
|||
return FAILURE;
|
||||
}
|
||||
|
||||
file = php_stream_fopen_tmpfile();
|
||||
if (file == NULL) {
|
||||
php_error_docref(NULL, E_WARNING, "Unable to create temporary file.");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
/* perform the conversion and then pass the request on to the innerstream */
|
||||
membuf = php_stream_memory_get_buffer(ts->innerstream, &memsize);
|
||||
file = php_stream_fopen_tmpfile();
|
||||
php_stream_write(file, membuf, memsize);
|
||||
pos = php_stream_tell(ts->innerstream);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue