Skip to content

Commit e745b71

Browse files
committed
Merge tag 'php-8.4.3' into was-8.4.x
Tag for php-8.4.3
2 parents 42304a6 + 092e536 commit e745b71

File tree

247 files changed

+12174
-9275
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

247 files changed

+12174
-9275
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ php
177177
/ext/*/configure.ac
178178
/ext/*/run-tests.php
179179

180+
# Generated by ./configure if libc might be musl
181+
/ext/gettext/tests/locale/en_US
182+
180183
# ------------------------------------------------------------------------------
181184
# Generated by Windows build system
182185
# ------------------------------------------------------------------------------

NEWS

Lines changed: 132 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,183 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
19 Dec 2024, PHP 8.4.2
3+
16 Jan 2025, PHP 8.4.3
44

55
- BcMath:
6-
. Fixed bug GH-16978 (Avoid unnecessary padding with leading zeros)
6+
. Fixed bug GH-17049 (Correctly compare 0 and -0). (Saki Takamachi)
7+
. Fixed bug GH-17061 (Now Number::round() does not remove trailing zeros).
78
(Saki Takamachi)
9+
. Fixed bug GH-17064 (Correctly round rounding mode with zero edge case).
10+
(Saki Takamachi)
11+
. Fixed bug GH-17275 (Fixed the calculation logic of dividend scale).
12+
(Saki Takamachi)
13+
14+
- Core:
15+
. Fixed bug OSS-Fuzz #382922236 (Duplicate dynamic properties in hooked object
16+
iterator properties table). (ilutov)
17+
. Fixed unstable get_iterator pointer for hooked classes in shm on Windows.
18+
(ilutov)
19+
. Fixed bug GH-17106 (ZEND_MATCH_ERROR misoptimization). (ilutov)
20+
. Fixed bug GH-17162 (zend_array_try_init() with dtor can cause engine UAF).
21+
(nielsdos)
22+
. Fixed bug GH-17101 (AST->string does not reproduce constructor property
23+
promotion correctly). (nielsdos)
24+
. Fixed bug GH-17200 (Incorrect dynamic prop offset in hooked prop iterator).
25+
(ilutov)
26+
. Fixed bug GH-17216 (Trampoline crash on error). (nielsdos)
27+
28+
- DBA:
29+
. Skip test if inifile is disabled. (orlitzky)
30+
31+
- DOM:
32+
. Fixed bug GH-17145 (DOM memory leak). (nielsdos)
33+
. Fixed bug GH-17201 (Dom\TokenList issues with interned string replace).
34+
(nielsdos)
35+
. Fixed bug GH-17224 (UAF in importNode). (nielsdos)
36+
37+
- Embed:
38+
. Make build command for program using embed portable. (dunglas)
39+
40+
- FFI:
41+
. Fixed bug #79075 (FFI header parser chokes on comments). (nielsdos)
42+
. Fix memory leak on ZEND_FFI_TYPE_CHAR conversion failure. (nielsdos)
43+
. Fixed bug GH-16013 and bug #80857 (Big endian issues). (Dmitry, nielsdos)
44+
45+
- Fileinfo:
46+
. Fixed bug GH-17039 (PHP 8.4: Incorrect MIME content type). (nielsdos)
847

9-
- Calendar:
10-
. Fixed jdtogregorian overflow. (David Carlier)
11-
. Fixed cal_to_jd julian_days argument overflow. (David Carlier)
48+
- FPM:
49+
. Fixed bug GH-13437 (FPM: ERROR: scoreboard: failed to lock (already
50+
locked)). (Jakub Zelenka)
51+
. Fixed bug GH-17112 (Macro redefinitions). (cmb, nielsdos)
52+
. Fixed bug GH-17208 (bug64539-status-json-encoding.phpt fail on 32-bits).
53+
(nielsdos)
54+
55+
- GD:
56+
. Fixed bug GH-16255 (Unexpected nan value in ext/gd/libgd/gd_filter.c).
57+
(nielsdos, cmb)
58+
. Ported fix for libgd bug 276 (Sometimes pixels are missing when storing
59+
images as BMPs). (cmb)
60+
61+
- Gettext:
62+
. Fixed bug GH-17202 (Segmentation fault ext/gettext/gettext.c
63+
bindtextdomain()). (Michael Orlitzky)
64+
65+
- Iconv:
66+
. Fixed bug GH-17047 (UAF on iconv filter failure). (nielsdos)
67+
68+
- LDAP:
69+
. Fixed bug GH-17280 (ldap_search() fails when $attributes array has holes).
70+
(nielsdos)
71+
72+
- LibXML:
73+
. Fixed bug GH-17223 (Memory leak in libxml encoding handling). (nielsdos)
74+
75+
- MBString:
76+
. Fixed bug GH-17112 (Macro redefinitions). (nielsdos, cmb)
77+
78+
- Opcache:
79+
. opcache_get_configuration() properly reports jit_prof_threshold. (cmb)
80+
. Fixed bug GH-17140 (Assertion failure in JIT trace exit with
81+
ZEND_FETCH_DIM_FUNC_ARG). (nielsdos, Dmitry)
82+
. Fixed bug GH-17151 (Incorrect RC inference of op1 of FETCH_OBJ and
83+
INIT_METHOD_CALL). (Dmitry, ilutov)
84+
. Fixed bug GH-17246 (GC during SCCP causes segfault). (Dmitry)
85+
. Fixed bug GH-17257 (UBSAN warning in ext/opcache/jit/zend_jit_vm_helpers.c).
86+
(nielsdos, Dmitry)
87+
88+
- PCNTL:
89+
. Fix memory leak in cleanup code of pcntl_exec() when a non stringable
90+
value is encountered past the first entry. (Girgias)
91+
92+
- PgSql:
93+
. Fixed bug GH-17158 (pg_fetch_result Shows Incorrect ArgumentCountError
94+
Message when Called With 1 Argument). (nielsdos)
95+
. Fixed further ArgumentCountError for calls with flexible
96+
number of arguments. (David Carlier)
97+
98+
- Phar:
99+
. Fixed bug GH-17137 (Segmentation fault ext/phar/phar.c). (nielsdos)
100+
101+
- SimpleXML:
102+
. Fixed bug GH-17040 (SimpleXML's unset can break DOM objects). (nielsdos)
103+
. Fixed bug GH-17153 (SimpleXML crash when using autovivification on
104+
document). (nielsdos)
105+
106+
- Sockets:
107+
. Fixed bug GH-16276 (socket_strerror overflow handling with INT_MIN).
108+
(David Carlier / cmb)
109+
. Fixed overflow on SO_LINGER values setting, strengthening values check
110+
on SO_SNDTIMEO/SO_RCVTIMEO for socket_set_option().
111+
(David Carlier)
112+
113+
- SPL:
114+
. Fixed bug GH-17198 (SplFixedArray assertion failure with get_object_vars).
115+
(nielsdos)
116+
. Fixed bug GH-17225 (NULL deref in spl_directory.c). (nielsdos)
117+
118+
- Streams:
119+
. Fixed bug GH-17037 (UAF in user filter when adding existing filter name due
120+
to incorrect error handling). (nielsdos)
121+
. Fixed bug GH-16810 (overflow on fopen HTTP wrapper timeout value).
122+
(David Carlier)
123+
. Fixed bug GH-17067 (glob:// wrapper doesn't cater to CWD for ZTS builds).
124+
(cmb)
125+
126+
- Windows:
127+
. Hardened proc_open() against cmd.exe hijacking. (cmb)
128+
129+
- XML:
130+
. Fixed bug GH-1718 (unreachable program point in zend_hash). (nielsdos)
131+
132+
05 Dec 2024, PHP 8.4.2
133+
134+
- BcMath:
135+
. Fixed bug GH-16978 (Avoid unnecessary padding with leading zeros).
136+
(Saki Takamachi)
12137

13138
- COM:
14139
. Fixed bug GH-16991 (Getting typeinfo of non DISPATCH variant segfaults).
15140
(cmb)
16141

17142
- Core:
18-
. Fail early in *nix configuration build script. (hakre)
19143
. Fixed bug GH-16344 (setRawValueWithoutLazyInitialization() and
20144
skipLazyInitialization() may change initialized proxy). (Arnaud)
21-
. Fixed bug GH-16727 (Opcache bad signal 139 crash in ZTS bookworm
22-
(frankenphp)). (nielsdos)
23-
. Fixed bug GH-16799 (Assertion failure at Zend/zend_vm_execute.h:7469).
24-
(nielsdos)
25-
. Fixed bug GH-16630 (UAF in lexer with encoding translation and heredocs).
26-
(nielsdos)
27145
. Fix is_zend_ptr() huge block comparison. (nielsdos)
28146
. Fixed potential OOB read in zend_dirname() on Windows. (cmb)
29147
. Fixed bug GH-15964 (printf() can strip sign of -INF). (divinity76, cmb)
30148

31149
- Curl:
32-
. Fixed bug GH-16802 (open_basedir bypass using curl extension). (nielsdos)
33150
. Fix various memory leaks in curl mime handling. (nielsdos)
34151

35152
- DBA:
36153
. Fixed bug GH-16990 (dba_list() is now zero-indexed instead of using
37154
resource ids) (kocsismate)
38155

39156
- DOM:
40-
. Fixed bug GH-16777 (Calling the constructor again on a DOM object after it
41-
is in a document causes UAF). (nielsdos)
42157
. Fixed bug GH-16906 (Reloading document can cause UAF in iterator).
43158
(nielsdos)
44159

45160
- FPM:
46-
. Fixed GH-16432 (PHP-FPM 8.2 SIGSEGV in fpm_get_status). (Jakub Zelenka)
47161
. Fixed bug GH-16932 (wrong FPM status output). (Jakub Zelenka, James Lucas)
48162

49-
- GD:
50-
. Fixed GH-16776 (imagecreatefromstring overflow). (David Carlier)
51-
52163
- GMP:
53164
. Fixed bug GH-16890 (array_sum() with GMP can loose precision (LLP64)).
54165
(cmb)
55166

56-
- Hash:
57-
. Fixed GH-16711: Segfault in mhash(). (Girgias)
58-
59167
- Opcache:
60168
. Fixed bug GH-16851 (JIT_G(enabled) not set correctly on other threads).
61169
(dktapps)
62170
. Fixed bug GH-16902 (Set of opcache tests fail zts+aarch64). (nielsdos)
63171
. Fixed bug GH-16879 (JIT dead code skipping does not update call_level).
64172
(nielsdos)
65173

66-
- OpenSSL:
67-
. Prevent unexpected array entry conversion when reading key. (nielsdos)
68-
. Fix various memory leaks related to openssl exports. (nielsdos)
69-
. Fix memory leak in php_openssl_pkey_from_zval(). (nielsdos)
70-
71-
- PDO:
72-
. Fixed memory leak of `setFetchMode()`. (SakiTakamachi)
73-
74-
- Phar:
75-
. Fixed bug GH-16695 (phar:// tar parser and zero-length file header blocks).
76-
(nielsdos, Hans Krentel)
174+
- SAPI:
175+
. Fixed bug GH-16998 (UBSAN warning in rfc1867). (nielsdos)
77176

78177
- PHPDBG:
79178
. Fixed bug GH-15208 (Segfault with breakpoint map and phpdbg_clear()).
80179
(nielsdos)
81180

82-
- SAPI:
83-
. Fixed bug GH-16998 (UBSAN warning in rfc1867). (nielsdos)
84-
85-
- SimpleXML:
86-
. Fixed bug GH-16808 (Segmentation fault in RecursiveIteratorIterator
87-
->current() with a xml element input). (nielsdos)
88-
89-
- SOAP:
90-
. Fix make check being invoked in ext/soap. (Ma27)
91-
92181
- Standard:
93182
. Fixed bug GH-16905 (Internal iterator functions can't handle UNDEF
94183
properties). (nielsdos)

Zend/Optimizer/zend_inference.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,6 +1970,10 @@ static uint32_t get_ssa_alias_types(zend_ssa_alias_kind alias) {
19701970
/* TODO: support for array keys and ($str . "")*/ \
19711971
__type |= MAY_BE_RCN; \
19721972
} \
1973+
if ((__type & MAY_BE_RC1) && (__type & MAY_BE_OBJECT)) {\
1974+
/* TODO: object may be captured by magic handlers */\
1975+
__type |= MAY_BE_RCN; \
1976+
} \
19731977
if (__ssa_var->alias) { \
19741978
__type |= get_ssa_alias_types(__ssa_var->alias); \
19751979
} \

Zend/Optimizer/zend_optimizer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ bool zend_optimizer_replace_by_const(zend_op_array *op_array,
640640
case ZEND_SWITCH_LONG:
641641
case ZEND_SWITCH_STRING:
642642
case ZEND_MATCH:
643+
case ZEND_MATCH_ERROR:
643644
case ZEND_JMP_NULL: {
644645
zend_op *end = op_array->opcodes + op_array->last;
645646
while (opline < end) {
@@ -652,6 +653,7 @@ bool zend_optimizer_replace_by_const(zend_op_array *op_array,
652653
&& opline->opcode != ZEND_SWITCH_LONG
653654
&& opline->opcode != ZEND_SWITCH_STRING
654655
&& opline->opcode != ZEND_MATCH
656+
&& opline->opcode != ZEND_MATCH_ERROR
655657
&& opline->opcode != ZEND_JMP_NULL
656658
&& (opline->opcode != ZEND_FREE
657659
|| opline->extended_value != ZEND_FREE_ON_RETURN);

Zend/tests/bug54268.phpt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ $zend_mm_enabled = getenv("USE_ZEND_ALLOC");
88
if ($zend_mm_enabled === "0") {
99
die("skip Zend MM disabled");
1010
}
11-
$tracing = extension_loaded("Zend OPcache")
12-
&& ($conf = opcache_get_configuration()["directives"])
13-
&& array_key_exists("opcache.jit", $conf)
14-
&& $conf["opcache.jit"] === "tracing";
15-
if (PHP_OS_FAMILY === "Windows" && PHP_INT_SIZE == 8 && $tracing) {
16-
$url = "https://github.com/php/php-src/issues/15709";
17-
die("xfail Test fails on Windows x64 (VS17) and tracing JIT; see $url");
18-
}
1911
?>
2012
--FILE--
2113
<?php

Zend/tests/gh16509.phpt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
--TEST--
22
GH-16509: Incorrect lineno reported for function redeclaration
3-
--SKIPIF--
4-
<?php
5-
$tracing = extension_loaded("Zend OPcache")
6-
&& ($conf = opcache_get_configuration()["directives"])
7-
&& array_key_exists("opcache.jit", $conf)
8-
&& $conf["opcache.jit"] === "tracing";
9-
if (PHP_OS_FAMILY === "Windows" && PHP_INT_SIZE == 8 && $tracing) {
10-
$url = "https://github.com/php/php-src/pull/14919#issuecomment-2259003979";
11-
die("xfail Test fails on Windows x64 (VS17) and tracing JIT; see $url");
12-
}
13-
?>
143
--FILE--
154
<?php
165

Zend/tests/gh17162.phpt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
GH-17162 (zend_array_try_init() with dtor can cause engine UAF)
3+
--FILE--
4+
<?php
5+
class Test {
6+
function __destruct() {
7+
global $box;
8+
$box->value = null;
9+
}
10+
}
11+
$box = [new Test];
12+
// Using getimagesize() for the test because it's always available,
13+
// but any function that uses zend_try_array_init() would work.
14+
try {
15+
getimagesize("dummy", $box);
16+
} catch (Error $e) {
17+
echo $e->getMessage(), "\n";
18+
}
19+
?>
20+
--EXPECT--
21+
Attempt to assign property "value" on null

Zend/tests/gh8841.phpt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
--TEST--
22
GH-8841 (php-cli core dump calling a badly formed function)
3-
--SKIPIF--
4-
<?php
5-
$tracing = extension_loaded("Zend OPcache")
6-
&& ($conf = opcache_get_configuration()["directives"])
7-
&& array_key_exists("opcache.jit", $conf)
8-
&& $conf["opcache.jit"] === "tracing";
9-
if (PHP_OS_FAMILY === "Windows" && PHP_INT_SIZE == 8 && $tracing) {
10-
$url = "https://github.com/php/php-src/pull/14919#issuecomment-2259003979";
11-
die("xfail Test fails on Windows x64 (VS17) and tracing JIT; see $url");
12-
}
13-
?>
143
--FILE--
154
<?php
165
register_shutdown_function(function() {

Zend/tests/gh9407.phpt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
--TEST--
22
GH-9407: LSP error in eval'd code refers to wrong class for static type
3-
--SKIPIF--
4-
<?php
5-
$tracing = extension_loaded("Zend OPcache")
6-
&& ($conf = opcache_get_configuration()["directives"])
7-
&& array_key_exists("opcache.jit", $conf)
8-
&& $conf["opcache.jit"] === "tracing";
9-
if (PHP_OS_FAMILY === "Windows" && PHP_INT_SIZE == 8 && $tracing) {
10-
$url = "https://github.com/php/php-src/pull/14919#issuecomment-2259003979";
11-
die("xfail Test fails on Windows x64 (VS17) and tracing JIT; see $url");
12-
}
13-
?>
143
--FILE--
154
<?php
165

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
GH-17216 (Trampoline crash on error)
3+
--FILE--
4+
<?php
5+
class TrampolineTest {
6+
public function __call(string $name, array $arguments) {
7+
var_dump($name, $arguments);
8+
}
9+
}
10+
$o = new TrampolineTest();
11+
$callback = [$o, 'trampoline'];
12+
$array = ["a" => "b", 1];
13+
try {
14+
forward_static_call_array($callback, $array);
15+
} catch (Error $e) {
16+
echo $e->getMessage(), "\n";
17+
}
18+
echo "Done\n";
19+
?>
20+
--EXPECT--
21+
Cannot use positional argument after named argument
22+
Done

0 commit comments

Comments
 (0)