We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2565eb commit 2871c70Copy full SHA for 2871c70
ext/standard/exec.c
@@ -253,7 +253,7 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str)
253
#endif
254
255
256
- cmd = zend_string_alloc(2 * l, 0);
+ cmd = zend_string_safe_alloc(2, l, 0, 0);
257
258
for (x = 0, y = 0; x < l; x++) {
259
int mb_len = php_mblen(str + x, (l - x));
@@ -345,7 +345,7 @@ PHPAPI zend_string *php_escape_shell_arg(char *str)
345
size_t estimate = (4 * l) + 3;
346
347
348
- cmd = zend_string_alloc(4 * l + 2, 0); /* worst case */
+ cmd = zend_string_safe_alloc(4, l, 2, 0); /* worst case */
349
350
#ifdef PHP_WIN32
351
ZSTR_VAL(cmd)[y++] = '"';
0 commit comments