if (command_len) {
if (command_len != strlen(command)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Input string contains NULL bytes");
+ php_error_docref(NULL, E_ERROR, "Input string contains NULL bytes");
return;
}
- RETVAL_STR(php_escape_shell_cmd(command));
+ cmd = php_escape_shell_cmd(command);
+ RETVAL_STRINGL_CHECK(cmd, strlen(cmd), 0);
} else {
RETVAL_EMPTY_STRING();
}
if (argument) {
if (argument_len != strlen(argument)) {
- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Input string contains NULL bytes");
+ php_error_docref(NULL, E_ERROR, "Input string contains NULL bytes");
return;
}
- RETVAL_STR(php_escape_shell_arg(argument));
+ cmd = php_escape_shell_arg(argument);
+ RETVAL_STRINGL_CHECK(cmd, strlen(cmd), 0);
}
}
/* }}} */
}
stream = php_stream_fopen_from_pipe(in, "rb");
- total_readbytes = php_stream_copy_to_mem(stream, &ret, PHP_STREAM_COPY_ALL, 0);
+ ret = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0);
php_stream_close(stream);
- if (ret && ZSTR_LEN(ret) > 0) {
- RETVAL_STR(ret);
+ if (total_readbytes > 0) {
+ RETVAL_STRINGL_CHECK(ret, total_readbytes, 0);
}
}
/* }}} */