summaryrefslogtreecommitdiff
path: root/ext/standard/exec.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2016-11-03 22:12:23 -0700
committerStanislav Malyshev <stas@php.net>2016-11-03 22:30:46 -0700
commitd858b4c77fa28ff9b0a597141a58f51803bafc2b (patch)
tree05483b61a43ca753e84e5573ae9a88aa8a4d2950 /ext/standard/exec.c
parent2fa455128c7f6c42eb00a43f8bb28a395af4aeda (diff)
parent40f7fea89719da13505a521115101e74260d3fdb (diff)
downloadphp-git-d858b4c77fa28ff9b0a597141a58f51803bafc2b.tar.gz
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6: Add length check for bzcompress too - fix for bug #73356
Diffstat (limited to 'ext/standard/exec.c')
-rw-r--r--ext/standard/exec.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index 7e21bce098..18480c3891 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -321,7 +321,7 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str)
ZSTR_VAL(cmd)[y++] = str[x];
break;
#else
- /* % is Windows specific for environmental variables, ^%PATH% will
+ /* % is Windows specific for environmental variables, ^%PATH% will
output PATH while ^%PATH^% will not. escapeshellcmd->val will escape all % and !.
*/
case '%':
@@ -482,8 +482,7 @@ PHP_FUNCTION(escapeshellcmd)
php_error_docref(NULL, E_ERROR, "Input string contains NULL bytes");
return;
}
- cmd = php_escape_shell_cmd(command);
- RETVAL_STRINGL_CHECK(cmd, strlen(cmd), 0);
+ RETVAL_STR(php_escape_shell_cmd(command));
} else {
RETVAL_EMPTY_STRING();
}
@@ -506,8 +505,7 @@ PHP_FUNCTION(escapeshellarg)
php_error_docref(NULL, E_ERROR, "Input string contains NULL bytes");
return;
}
- cmd = php_escape_shell_arg(argument);
- RETVAL_STRINGL_CHECK(cmd, strlen(cmd), 0);
+ RETVAL_STR(php_escape_shell_arg(argument));
}
}
/* }}} */
@@ -539,8 +537,8 @@ PHP_FUNCTION(shell_exec)
ret = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0);
php_stream_close(stream);
- if (total_readbytes > 0) {
- RETVAL_STRINGL_CHECK(ret, total_readbytes, 0);
+ if (ret && ZSTR_LEN(ret) > 0) {
+ RETVAL_STR(ret);
}
}
/* }}} */