Skip to content

Commit 48e0707

Browse files
zhou1615cmb69
authored andcommitted
spl_ptr_llist_offset() is not supposed to return NULL here
This issue has found by a static analyzer. Closes GH-8272.
1 parent c9c5ee3 commit 48e0707

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/spl/spl_dllist.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,6 +1191,7 @@ PHP_METHOD(SplDoublyLinkedList, add)
11911191

11921192
/* Get the element we want to insert before */
11931193
element = spl_ptr_llist_offset(intern->llist, index, intern->flags & SPL_DLLIST_IT_LIFO);
1194+
ZEND_ASSERT(element != NULL);
11941195

11951196
ZVAL_COPY(&elem->data, value);
11961197
SPL_LLIST_RC(elem) = 1;

0 commit comments

Comments
 (0)