mirror of
https://github.com/php/php-src.git
synced 2026-04-22 15:38:49 +02:00
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix bug #79410 (system() swallows last chunk if it is exactly 4095 bytes without newline)
This commit is contained in:
@@ -159,6 +159,13 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value)
|
||||
b = buf;
|
||||
}
|
||||
if (bufl) {
|
||||
/* output remaining data in buffer */
|
||||
if (type == 1 && buf != b) {
|
||||
PHPWRITE(buf, bufl);
|
||||
if (php_output_get_level() < 1) {
|
||||
sapi_flush();
|
||||
}
|
||||
}
|
||||
/* strip trailing whitespaces if we have not done so already */
|
||||
if ((type == 2 && buf != b) || type != 2) {
|
||||
l = bufl;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #79410 (system() swallows last chunk if it is exactly 4095 bytes without newline)
|
||||
--FILE--
|
||||
<?php
|
||||
ob_start();
|
||||
system(getenv('TEST_PHP_EXECUTABLE') . ' -n -r "echo str_repeat(\".\", 4095);"');
|
||||
var_dump(strlen(ob_get_clean()));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(4095)
|
||||
Reference in New Issue
Block a user