From 2a2cc2ccce3855f6244b7ea3449282e24cc2cf06 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 22 Jan 2025 22:38:02 +0100 Subject: [PATCH 1/2] Fix type confusion with session SID constant Closes GH-17548. --- NEWS | 3 +++ ext/session/session.c | 4 ++-- ext/session/tests/SID_type_confusion.phpt | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 ext/session/tests/SID_type_confusion.phpt diff --git a/NEWS b/NEWS index 6744e7ed5b865..9c75b031eb19e 100644 --- a/NEWS +++ b/NEWS @@ -48,6 +48,9 @@ PHP NEWS - PHPDBG: . Fix crashes in function registration + test. (nielsdos, Girgias) +- Session: + . Fix type confusion with session SID constant. (nielsdos) + - SimpleXML: . Fixed bug GH-17409 (Assertion failure Zend/zend_hash.c:1730). (nielsdos) diff --git a/ext/session/session.c b/ext/session/session.c index b838b132b16d0..b261f9a35594a 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1479,7 +1479,7 @@ PHPAPI zend_result php_session_reset_id(void) /* {{{ */ smart_str_appends(&var, ZSTR_VAL(PS(id))); smart_str_0(&var); if (sid) { - zval_ptr_dtor_str(sid); + zval_ptr_dtor(sid); ZVAL_STR(sid, smart_str_extract(&var)); } else { REGISTER_STRINGL_CONSTANT("SID", ZSTR_VAL(var.s), ZSTR_LEN(var.s), 0); @@ -1487,7 +1487,7 @@ PHPAPI zend_result php_session_reset_id(void) /* {{{ */ } } else { if (sid) { - zval_ptr_dtor_str(sid); + zval_ptr_dtor(sid); ZVAL_EMPTY_STRING(sid); } else { REGISTER_STRINGL_CONSTANT("SID", "", 0, 0); diff --git a/ext/session/tests/SID_type_confusion.phpt b/ext/session/tests/SID_type_confusion.phpt new file mode 100644 index 0000000000000..837f0784d40ef --- /dev/null +++ b/ext/session/tests/SID_type_confusion.phpt @@ -0,0 +1,19 @@ +--TEST-- +SID constant type confusion +--EXTENSIONS-- +session +--SKIPIF-- + +--INI-- +session.use_cookies=0 +session.use_only_cookies=1 +--FILE-- + +--EXPECT-- +string(0) "" From 10ccb6bf0d4593e7250ac699addf31deee82caa0 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 23 Jan 2025 19:17:24 +0100 Subject: [PATCH 2/2] Drop intel macOS build from push (#17551) This build becomes less relevant as all currently sold Apple computers contain Apple Silicon CPUs. This build rarely fails in isolation anyway. For the time being, we'll keep the nightly builds in all configurations. --- .github/workflows/push.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4705b8874dd05..b92a55b58b87d 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -198,8 +198,6 @@ jobs: fail-fast: false matrix: include: - - os: 13 - arch: X64 - os: 14 arch: ARM64 name: MACOS_${{ matrix.arch }}_DEBUG_NTS