Skip to content

Commit 1073814

Browse files
committed
ext/standard/exec.c: Use ZPP path modifier to check for nul bytes
1 parent e7c4d54 commit 1073814

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ext/standard/exec.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -514,17 +514,13 @@ PHP_FUNCTION(shell_exec)
514514
php_stream *stream;
515515

516516
ZEND_PARSE_PARAMETERS_START(1, 1)
517-
Z_PARAM_STRING(command, command_len)
517+
Z_PARAM_PATH(command, command_len)
518518
ZEND_PARSE_PARAMETERS_END();
519519

520520
if (!command_len) {
521521
zend_argument_cannot_be_empty_error(1);
522522
RETURN_THROWS();
523523
}
524-
if (strlen(command) != command_len) {
525-
zend_argument_value_error(1, "must not contain any null bytes");
526-
RETURN_THROWS();
527-
}
528524

529525
#ifdef PHP_WIN32
530526
if ((in=VCWD_POPEN(command, "rt"))==NULL) {

0 commit comments

Comments
 (0)