From c12141c860ad9ab9321704f9c0062b308fce6c6b Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Fri, 20 May 2022 19:11:00 +0200 Subject: [PATCH 1/3] Reduce the scope of XFAIL (#8592) --- ext/opcache/tests/bug78175_2.phpt | 3 +-- ext/opcache/tests/bug78376.phpt | 3 +-- ext/opcache/tests/preload_method_static_vars.phpt | 3 +-- ext/opcache/tests/preload_trait_static.phpt | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ext/opcache/tests/bug78175_2.phpt b/ext/opcache/tests/bug78175_2.phpt index 37c025057d9..728a5c8fe1e 100644 --- a/ext/opcache/tests/bug78175_2.phpt +++ b/ext/opcache/tests/bug78175_2.phpt @@ -9,9 +9,8 @@ opcache.preload={PWD}/preload_bug78175_2.inc ---XFAIL-- -GH-8588 --FILE-- ---XFAIL-- -GH-8588 --FILE-- ---XFAIL-- -GH-8588 --FILE-- ---XFAIL-- -GH-8588 --FILE-- Date: Sun, 22 May 2022 19:16:52 +0200 Subject: [PATCH 2/3] Fix undefined behavior in php_set_inet6_addr Postfix `++` on `NULL` is undefined behavior Closes GH-8607 --- NEWS | 1 + ext/sockets/sockaddr_conv.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 722d5a7ce47..e39b10d1a65 100644 --- a/NEWS +++ b/NEWS @@ -110,6 +110,7 @@ PHP NEWS - Sockets: . Fixed Solaris builds. (David Carlier) + . Fix undefined behavior in php_set_inet6_addr. (ilutov) - SPL: . Fixed bug GH-8121 (SplFileObject - seek and key with csv file inconsistent). diff --git a/ext/sockets/sockaddr_conv.c b/ext/sockets/sockaddr_conv.c index 57996612d2d..6aaa5780298 100644 --- a/ext/sockets/sockaddr_conv.c +++ b/ext/sockets/sockaddr_conv.c @@ -60,11 +60,13 @@ int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, php_socket *php_ } - if (scope++) { + if (scope) { zend_long lval = 0; double dval = 0; unsigned scope_id = 0; + scope++; + if (IS_LONG == is_numeric_string(scope, strlen(scope), &lval, &dval, 0)) { if (lval > 0 && (zend_ulong)lval <= UINT_MAX) { scope_id = lval; From c71e75bb111e5a3c7b2f6a7e5d56a4e71f325d46 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Sun, 22 May 2022 23:29:32 +0200 Subject: [PATCH 3/3] [skip ci] Add NEWS entry --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index b5f2f3e09ee..f27096a5e3c 100644 --- a/NEWS +++ b/NEWS @@ -144,6 +144,7 @@ PHP NEWS - Sockets: . Fixed Solaris builds. (David Carlier) + . Fix undefined behavior in php_set_inet6_addr. (ilutov) - SPL: . Fixed bug GH-8121 (SplFileObject - seek and key with csv file inconsistent).