diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2021-02-01 12:59:22 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2021-02-01 13:00:22 +0100 |
commit | 766d5846b1674817fdc9b2dc2d28aff13a43bcf3 (patch) | |
tree | f407bd3408f13911280ce5eeb338a09e6da3ae99 | |
parent | cab1ea46e76dba2aac81b77cf77dc8bbcb53ec87 (diff) | |
parent | 7e9479083d6dc6d84c393a96eb718bccc0185b9b (diff) | |
download | php-git-766d5846b1674817fdc9b2dc2d28aff13a43bcf3.tar.gz |
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
Fix #80654: file_get_contents() maxlen fails above (2**31)-1 bytes
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | ext/standard/file.c | 4 | ||||
-rw-r--r-- | ext/standard/streamsfuncs.c | 4 |
3 files changed, 4 insertions, 9 deletions
@@ -11,12 +11,15 @@ PHP NEWS preloaded JITted code). (Dmitry) . Fixed bug #80682 (opcache doesn't honour pcre.jit option). (Remi) - - Phar: . Fixed bug #75850 (Unclear error message wrt. __halt_compiler() w/o semicolon) (cmb) . Fixed bug #70091 (Phar does not mark UTF-8 filenames in ZIP archives). (cmb) +- Standard: + . Fixed bug #80654 (file_get_contents() maxlen fails above (2**31)-1 bytes). + (cmb) + 21 Jan 2021, PHP 8.0.2 - Core: diff --git a/ext/standard/file.c b/ext/standard/file.c index d125f2b8e7..adca64eecb 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -564,10 +564,6 @@ PHP_FUNCTION(file_get_contents) RETURN_FALSE; } - if (maxlen > INT_MAX) { - php_error_docref(NULL, E_WARNING, "maxlen truncated from " ZEND_LONG_FMT " to %d bytes", maxlen, INT_MAX); - maxlen = INT_MAX; - } if ((contents = php_stream_copy_to_mem(stream, maxlen, 0)) != NULL) { RETVAL_STR(contents); } else { diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 9ca2def099..fb4911bcbe 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -458,10 +458,6 @@ PHP_FUNCTION(stream_get_contents) } } - if (maxlen > INT_MAX) { - php_error_docref(NULL, E_WARNING, "Argument #2 ($maxlength) is truncated from " ZEND_LONG_FMT " to %d bytes", maxlen, INT_MAX); - maxlen = INT_MAX; - } if ((contents = php_stream_copy_to_mem(stream, maxlen, 0))) { RETURN_STR(contents); } else { |