ext/standard/exec.c: combine conditions, update docs

While `php_escape_shell_cmd()` did indeed `emalloc` a string that needed to be
freed by the caller in the original implementation that was put in GitHub
(see commit 257de2bade) a few months ago the
return type was changed to use `zend_string`, see #14353.

Closes GH-16313
This commit is contained in:
Daniel Scherzer 2024-09-18 17:45:13 -07:00 committed by Ilija Tovilo
parent e150b0b3a1
commit 6c9db6085a
No known key found for this signature in database
GPG Key ID: 5050C66BFCD1015A

View File

@ -118,11 +118,7 @@ PHPAPI int php_exec(int type, const char *cmd, zval *array, zval *return_value)
php_stream *stream;
size_t buflen, bufl = 0;
#if PHP_SIGCHILD
void (*sig_handler)() = NULL;
#endif
#if PHP_SIGCHILD
sig_handler = signal (SIGCHLD, SIG_DFL);
void (*sig_handler)() = signal(SIGCHLD, SIG_DFL);
#endif
#ifdef PHP_WIN32
@ -272,8 +268,7 @@ PHP_FUNCTION(passthru)
Escape all chars that could possibly be used to
break out of a shell command
This function emalloc's a string and returns the pointer.
Remember to efree it when done with it.
This function returns an owned zend_string, remember to release it when done.
*NOT* safe for binary strings
*/