Browse Source

Fixed bug #75511 (fread not free unused buffer)

pull/2729/merge
Xinchen Hui 9 years ago
parent
commit
1c1df0d937
  1. 3
      NEWS
  2. 4
      ext/standard/file.c

3
NEWS

@ -6,6 +6,9 @@ PHP NEWS
. Fixed bug #75384 (PHP seems incompatible with OneDrive files on demand). . Fixed bug #75384 (PHP seems incompatible with OneDrive files on demand).
(Anatol) (Anatol)
- Standard:
. Fixed bug #75511 (fread not free unused buffer). (Laruence)
23 Nov 2017, PHP 7.1.12 23 Nov 2017, PHP 7.1.12
- Core: - Core:

4
ext/standard/file.c

@ -1771,6 +1771,10 @@ PHPAPI PHP_FUNCTION(fread)
/* needed because recv/read/gzread doesnt put a null at the end*/ /* needed because recv/read/gzread doesnt put a null at the end*/
Z_STRVAL_P(return_value)[Z_STRLEN_P(return_value)] = 0; 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…
Cancel
Save