mirror of
https://github.com/php/php-src.git
synced 2024-12-14 20:33:36 +08:00
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fixed bug #75511 (fread not free unused buffer)
This commit is contained in:
commit
bc38c06752
@ -1815,6 +1815,10 @@ PHPAPI PHP_FUNCTION(fread)
|
||||
|
||||
/* needed because recv/read/gzread doesnt put a null at the end*/
|
||||
Z_STRVAL_P(return_value)[Z_STRLEN_P(return_value)] = 0;
|
||||
|
||||
if (len > Z_STRLEN_P(return_value) * 2) {
|
||||
Z_STR_P(return_value) = zend_string_truncate(Z_STR_P(return_value), Z_STRLEN_P(return_value), 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user