Merge branch 'PHP-8.1' into PHP-8.2

* PHP-8.1:
  Fix incorrect dtor for persistent sdl->encoders
This commit is contained in:
Niels Dossche 2023-10-25 17:54:46 +02:00
commit 07de4b69d4
2 changed files with 2 additions and 1 deletions

1
NEWS
View file

@ -38,6 +38,7 @@ PHP NEWS
. Fix incorrect uri check in SOAP caching. (nielsdos)
. Fix segfault and assertion failure with refcounted props and arrays.
(nielsdos)
. Fix potential crash with an edge case of persistent encoders. (nielsdos)
- Streams:
. Fixed bug #75708 (getimagesize with "&$imageinfo" fails on StreamWrappers).

View file

@ -155,7 +155,7 @@ encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type)
}
if (sdl->encoders == NULL) {
sdl->encoders = pemalloc(sizeof(HashTable), sdl->is_persistent);
zend_hash_init(sdl->encoders, 0, NULL, delete_encoder, sdl->is_persistent);
zend_hash_init(sdl->encoders, 0, NULL, sdl->is_persistent ? delete_encoder_persistent : delete_encoder, sdl->is_persistent);
}
zend_hash_str_update_ptr(sdl->encoders, nscat, len, new_enc);
enc = new_enc;