Skip to content

Commit 65428d8

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Error on resource ID space overflow
2 parents 70f516d + 1d50625 commit 65428d8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Zend/zend_list.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ ZEND_API zval* ZEND_FASTCALL zend_list_insert(void *ptr, int type)
3737
index = zend_hash_next_free_element(&EG(regular_list));
3838
if (index == 0) {
3939
index = 1;
40+
} else if (index == INT_MAX) {
41+
zend_error_noreturn(E_ERROR, "Resource ID space overflow");
4042
}
4143
ZVAL_NEW_RES(&zv, index, ptr, type);
4244
return zend_hash_index_add_new(&EG(regular_list), index, &zv);

0 commit comments

Comments
 (0)