diff --git a/NEWS b/NEWS index 3716fde8fe1..c281554ab33 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.4.12 +- Hash: + . Fix crash on clone failure. (nielsdos) + - Intl: . Fix memleak on failure in collator_get_sort_key(). (nielsdos) @@ -14,6 +17,9 @@ PHP NEWS return value check). (nielsdos, botovq) . Fix error return check of EVP_CIPHER_CTX_ctrl(). (nielsdos) +- Sockets: + . Fix some potential crashes on incorrect argument value. (nielsdos) + 31 Jul 2025, PHP 8.4.11 - Calendar: diff --git a/ext/hash/hash.c b/ext/hash/hash.c index cda85c730e6..6d03bbcca7c 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -849,8 +849,6 @@ PHP_FUNCTION(hash_copy) RETVAL_OBJ(Z_OBJ_HANDLER_P(zhash, clone_obj)(Z_OBJ_P(zhash))); if (php_hashcontext_from_object(Z_OBJ_P(return_value))->context == NULL) { - zval_ptr_dtor(return_value); - zend_throw_error(NULL, "Cannot copy hash"); RETURN_THROWS(); } diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 676d35bd429..5f0127e94f2 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -2589,7 +2589,6 @@ PHP_FUNCTION(socket_addrinfo_bind) } default: close(php_sock->bsd_socket); - zval_ptr_dtor(return_value); zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } @@ -2653,7 +2652,6 @@ PHP_FUNCTION(socket_addrinfo_connect) default: zend_argument_value_error(1, "socket type must be one of AF_UNIX, AF_INET, or AF_INET6"); close(php_sock->bsd_socket); - zval_ptr_dtor(return_value); RETURN_THROWS(); }