1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00
Files
Gina Peter Banyard 48d5ae98e7 ext/standard: Refactor exec.c public APIs to use zend_string pointers (#14353)
* Pull zend_string* from INI directive

* Ensure that mail.force_extra_parameters INI directive does not have any nul bytes

* ext/standard: Make php_escape_shell_cmd() take a zend_string* instead of char*

This saves on an expensive strlen() computation

* Convert E_ERROR to ValueError in php_escape_shell_cmd()

* ext/standard: Make php_escape_shell_arg() take a zend_string* instead of char*

This saves on an expensive strlen() computation

* Convert E_ERROR to ValueError in php_escape_shell_arg()
2024-05-29 10:59:17 +01:00

19 lines
352 B
PHP

--TEST--
Test escapeshellcmd() allowed argument length
--FILE--
<?php
ini_set('memory_limit', -1);
$var_2 = str_repeat('A', 1024*1024*64);
try {
escapeshellcmd($var_2);
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
===DONE===
--EXPECTF--
ValueError: Command exceeds the allowed length of %d bytes
===DONE===