diff --git a/NEWS b/NEWS index 0872d8dc542a8..782ee4be4d185 100644 --- a/NEWS +++ b/NEWS @@ -80,23 +80,24 @@ PHP NEWS - Posix: . Added validity check to the flags argument for posix_access(). (arshidkv12) - . Added validity check to the permissions argument for posix_mkfifo(). (arshidkv12) + . Added validity check to the permissions argument for posix_mkfifo(). + (arshidkv12) - Reflection: . Fixed bug GH-20217 (ReflectionClass::isIterable() incorrectly returns true for classes with property hooks). (alexandre-daubois) - Soap: - . Soap::__setCookie() when cookie name is a digit is now not stored and represented - as a string anymore but a int. (David Carlier) + . Soap::__setCookie() when cookie name is a digit is now not stored and + represented as a string anymore but a int. (David Carlier) - Sockets: - . Added the TCP_USER_TIMEOUT constant for Linux to set the maximum time in milliseconds - transmitted data can remain unacknowledged. (James Lucas) + . Added the TCP_USER_TIMEOUT constant for Linux to set the maximum time in + milliseconds transmitted data can remain unacknowledged. (James Lucas) . Added AF_UNSPEC support for sock_addrinfo_lookup() as a sole umbrella for AF_INET* family only. (David Carlier) - . Fixed GH-20532 (socket_addrinfo_lookup gives the error code with a new optional - parameter). (David Carlier) + . Fixed GH-20532 (socket_addrinfo_lookup gives the error code with a new + optional parameter). (David Carlier) - SPL: . DirectoryIterator key can now work better with filesystem supporting larger diff --git a/UPGRADING b/UPGRADING index b1db9893de628..f5bf9729855a1 100644 --- a/UPGRADING +++ b/UPGRADING @@ -43,8 +43,14 @@ PHP 8.6 UPGRADE NOTES . finfo_file() now works with remote streams. - Intl: - . Added IntlNumberRangeFormatter class to format an interval of two numbers with a given skeleton, locale, IntlNumberRangeFormatter::COLLAPSE_AUTO, IntlNumberRangeFormatter::COLLAPSE_NONE, IntlNumberRangeFormatter::COLLAPSE_UNIT, IntlNumberRangeFormatter::COLLAPSE_ALL collapse and - IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY and + . Added IntlNumberRangeFormatter class to format an interval of two numbers + with a given skeleton, locale, IntlNumberRangeFormatter::COLLAPSE_AUTO, + IntlNumberRangeFormatter::COLLAPSE_NONE, + IntlNumberRangeFormatter::COLLAPSE_UNIT, + IntlNumberRangeFormatter::COLLAPSE_ALL collapse and + IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, + IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, + IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY and IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE identity fallbacks. It is supported from icu 63. @@ -106,7 +112,8 @@ PHP 8.6 UPGRADE NOTES ======================================== - Standard: - . `clamp()` returns the given value if in range, else return the nearest bound. + . `clamp()` returns the given value if in range, else return the nearest + bound. RFC: https://wiki.php.net/rfc/clamp_v2 ======================================== @@ -189,8 +196,8 @@ PHP 8.6 UPGRADE NOTES - Core: . `printf()` using only `%s` and `%d` will be compiled into the equivalent - string interpolation, avoiding the overhead of a function call and repeatedly - parsing the format string. + string interpolation, avoiding the overhead of a function call and + repeatedly parsing the format string. . Arguments are now passed more efficiently to known constructors (e.g. when using new self()). . array_map() using a first-class callable or partial function application diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 1d8734d9fb076..c79bd44556da7 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -77,25 +77,21 @@ PHP 8.6 INTERNALS UPGRADE NOTES . build/gen_stub.php may now generate a _decl.h file in addition to the _arginfo.h file, if the stub declares enums and is annotated with - @generate-c-enums. For each enum the file will contain a C enum. Enum values - can be compared to the result of zend_enum_fetch_case_id(zend_object*). + @generate-c-enums. For each enum the file will contain a C enum. Enum + values can be compared to the result of + zend_enum_fetch_case_id(zend_object*). ======================== 3. Module changes ======================== -- ext/xml: - . Removed the XML_ExpatVersion() libxml compatibility wrapper, - as it was unused. - . Removed the XML_GetCurrentByteCount() libxml compatibility wrapper, - as it was unused and could return the wrong result. - - ext/mbstring: . Added GB18030-2022 to default encoding list for zh-CN. - ext/mysqlnd: . Dropped session_options parameter from all methods in mysqlnd_auth. - The same information is present in conn->options and should be used instead. + The same information is present in conn->options and should be used + instead. - ext/session: . php_session_flush() now returns a bool rather than a zend_result. @@ -111,6 +107,12 @@ PHP 8.6 INTERNALS UPGRADE NOTES . _php_error_log_ex() has been removed. . php_mail()'s extra_cmd parameter is now a zend_string*. +- ext/xml: + . Removed the XML_ExpatVersion() libxml compatibility wrapper, + as it was unused. + . Removed the XML_GetCurrentByteCount() libxml compatibility wrapper, + as it was unused and could return the wrong result. + ======================== 4. OpCode changes ======================== diff --git a/ext/sockets/conversions.c b/ext/sockets/conversions.c index e5894a1de8342..b4a13f39cd9c7 100644 --- a/ext/sockets/conversions.c +++ b/ext/sockets/conversions.c @@ -611,7 +611,7 @@ static void from_zval_write_sin6_addr(const zval *zaddr_str, char *addr6, ser_co } else { /* error already emitted, but let's emit another more relevant */ do_from_zval_err(ctx, "could not resolve address '%s' to get an AF_INET6 " - "address", Z_STRVAL_P(zaddr_str)); + "address", ZSTR_VAL(addr_str)); } zend_tmp_string_release(tmp_addr_str); diff --git a/ext/sockets/tests/gh21161.phpt b/ext/sockets/tests/gh21161.phpt new file mode 100644 index 0000000000000..8a3958a583d97 --- /dev/null +++ b/ext/sockets/tests/gh21161.phpt @@ -0,0 +1,19 @@ +--TEST-- +GH-21161 (IPV6_PKTINFO socket option crash with null addr array entry) +--EXTENSIONS-- +sockets +--SKIPIF-- + +--FILE-- + null, 'ifindex' => 0]); +?> +--EXPECTF-- +Warning: socket_set_option(): Host lookup failed [%i]: %s on line %d + +Warning: socket_set_option(): error converting user data (path: in6_pktinfo > addr): could not resolve address '' to get an AF_INET6 address in %s on line %d