diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index c576104139315..c6a022e8b7f7f 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -1257,6 +1257,7 @@ PHP_METHOD(SplDoublyLinkedList, add) /* Get the element we want to insert before */ element = spl_ptr_llist_offset(intern->llist, index, intern->flags & SPL_DLLIST_IT_LIFO); + ZEND_ASSERT(element != NULL); ZVAL_COPY_VALUE(&elem->data, value); SPL_LLIST_RC(elem) = 1;