1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Error on resource ID space overflow
This commit is contained in:
Nikita Popov
2021-08-31 10:42:52 +02:00

View File

@@ -37,6 +37,8 @@ ZEND_API zval* ZEND_FASTCALL zend_list_insert(void *ptr, int type)
index = zend_hash_next_free_element(&EG(regular_list));
if (index == 0) {
index = 1;
} else if (index == INT_MAX) {
zend_error_noreturn(E_ERROR, "Resource ID space overflow");
}
ZVAL_NEW_RES(&zv, index, ptr, type);
return zend_hash_index_add_new(&EG(regular_list), index, &zv);