0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 12:51:52 +00:00

Fix sprintf call for "converting parameter .. failed"

```
union _zend_function {
	zend_uchar type;	/* MUST be the first element of this struct! */
	uint32_t   quick_arg_flags;

	struct {
		zend_uchar type;  /* never used */
		zend_uchar arg_flags[3]; /* bitset of arg_info.pass_by_reference */
		uint32_t fn_flags;
		zend_string *function_name;
```
This commit is contained in:
Tyson Andre 2020-01-03 12:22:39 -05:00 committed by GitHub
parent 63d65a59ae
commit 7fd31e8b5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,7 +117,7 @@ static void v8js_call_php_func(zend_object *object, zend_function *method_ptr, c
{ {
if (v8js_to_zval(info[i], &fci.params[i], ctx->flags, isolate) == FAILURE) if (v8js_to_zval(info[i], &fci.params[i], ctx->flags, isolate) == FAILURE)
{ {
error_len = spprintf(&error, 0, "converting parameter #%d passed to %s() failed", i + 1, method_ptr->common.function_name); error_len = spprintf(&error, 0, "converting parameter #%d passed to %s() failed", i + 1, ZSTR_VAL(method_ptr->common.function_name));
if (error_len > std::numeric_limits<int>::max()) { if (error_len > std::numeric_limits<int>::max()) {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,