Skip to content

Commit 50b16fc

Browse files
committed
* fix zend_async_coroutine_callback_new
1 parent 460e4fa commit 50b16fc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Zend/zend_async_API.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ void coroutine_event_callback_dispose(
442442
ZEND_API zend_coroutine_event_callback_t *zend_async_coroutine_callback_new(
443443
zend_coroutine_t *coroutine, zend_async_event_callback_fn callback, size_t size)
444444
{
445+
ZEND_ASSERT(size == 0 || size >= sizeof(zend_coroutine_event_callback_t) &&
446+
"Size must be at least sizeof(zend_coroutine_event_callback_t)");
447+
445448
zend_coroutine_event_callback_t *coroutine_callback
446449
= ecalloc(1, size != 0 ? size : sizeof(zend_coroutine_event_callback_t));
447450

0 commit comments

Comments
 (0)