1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00

Merge branch 'PHP-5.6' into PHP-7.0

* PHP-5.6:
  More string length checks & fixes
This commit is contained in:
Stanislav Malyshev
2016-11-03 22:05:25 -07:00

View File

@@ -482,7 +482,8 @@ PHP_FUNCTION(escapeshellcmd)
php_error_docref(NULL, E_ERROR, "Input string contains NULL bytes");
return;
}
RETVAL_STR(php_escape_shell_cmd(command));
cmd = php_escape_shell_cmd(command);
RETVAL_STRINGL_CHECK(cmd, strlen(cmd), 0);
} else {
RETVAL_EMPTY_STRING();
}
@@ -505,7 +506,8 @@ PHP_FUNCTION(escapeshellarg)
php_error_docref(NULL, E_ERROR, "Input string contains NULL bytes");
return;
}
RETVAL_STR(php_escape_shell_arg(argument));
cmd = php_escape_shell_arg(argument);
RETVAL_STRINGL_CHECK(cmd, strlen(cmd), 0);
}
}
/* }}} */
@@ -537,8 +539,8 @@ PHP_FUNCTION(shell_exec)
ret = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0);
php_stream_close(stream);
if (ret && ZSTR_LEN(ret) > 0) {
RETVAL_STR(ret);
if (total_readbytes > 0) {
RETVAL_STRINGL_CHECK(ret, total_readbytes, 0);
}
}
/* }}} */