Skip to content

Commit 7736836

Browse files
committed
msgpack_convert: fix crash on callback with PHP 8
1 parent 31e98e4 commit 7736836

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

msgpack_convert.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,28 +296,27 @@ int msgpack_convert_object(zval *return_value, zval *tpl, zval *value) /* {{{ */
296296

297297
/* Run the constructor if there is one */
298298
if (ce->constructor && (ce->constructor->common.fn_flags & ZEND_ACC_PUBLIC)) {
299-
zval retval, params, function_name;
299+
zval retval;
300300
zend_fcall_info fci;
301301
zend_fcall_info_cache fcc;
302302

303+
memset(&fci, 0, sizeof(fci));
304+
memset(&fcc, 0, sizeof(fcc));
305+
303306
fci.size = sizeof(fci);
304307
#if PHP_VERSION_ID < 70100
305308
fci.function_table = EG(function_table);
306-
fci.symbol_table = NULL;
307309
#endif
308-
fci.function_name = function_name;
309310
fci.object = Z_OBJ_P(return_value);
310311
fci.retval = &retval;
311-
fci.param_count = 0;
312-
fci.params = &params;
313312
#if PHP_VERSION_ID < 80000
314313
fci.no_separation = 1;
315314
#endif
315+
316316
#if PHP_VERSION_ID < 70300
317317
fcc.initialized = 1;
318318
#endif
319319
fcc.function_handler = ce->constructor;
320-
321320
#if PHP_VERSION_ID < 70100
322321
fcc.calling_scope = EG(scope);
323322
#else

0 commit comments

Comments
 (0)