Skip to content

Commit 6c9db60

Browse files
DanielEScherzeriluuu1994
authored andcommitted
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 257de2b) a few months ago the return type was changed to use `zend_string`, see php#14353. Closes phpGH-16313
1 parent e150b0b commit 6c9db60

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

ext/standard/exec.c

+2-7
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,7 @@ PHPAPI int php_exec(int type, const char *cmd, zval *array, zval *return_value)
118118
php_stream *stream;
119119
size_t buflen, bufl = 0;
120120
#if PHP_SIGCHILD
121-
void (*sig_handler)() = NULL;
122-
#endif
123-
124-
#if PHP_SIGCHILD
125-
sig_handler = signal (SIGCHLD, SIG_DFL);
121+
void (*sig_handler)() = signal(SIGCHLD, SIG_DFL);
126122
#endif
127123

128124
#ifdef PHP_WIN32
@@ -272,8 +268,7 @@ PHP_FUNCTION(passthru)
272268
Escape all chars that could possibly be used to
273269
break out of a shell command
274270
275-
This function emalloc's a string and returns the pointer.
276-
Remember to efree it when done with it.
271+
This function returns an owned zend_string, remember to release it when done.
277272
278273
*NOT* safe for binary strings
279274
*/

0 commit comments

Comments
 (0)