Skip to content

Commit f5ed58f

Browse files
committed
Merge tag 'php-8.3.16' into was-8.3.x
Tag for php-8.3.16
2 parents 04db9e1 + bce6a51 commit f5ed58f

File tree

180 files changed

+2710
-842
lines changed

Some content is hidden

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

180 files changed

+2710
-842
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: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,115 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3+
16 Jan 2025, PHP 8.3.16
4+
5+
- Core:
6+
. Fixed bug GH-17106 (ZEND_MATCH_ERROR misoptimization). (ilutov)
7+
. Fixed bug GH-17162 (zend_array_try_init() with dtor can cause engine UAF).
8+
(nielsdos)
9+
. Fixed bug GH-17101 (AST->string does not reproduce constructor property
10+
promotion correctly). (nielsdos)
11+
. Fixed bug GH-17211 (observer segfault on function loaded with dl()).
12+
(Arnaud)
13+
. Fixed bug GH-17216 (Trampoline crash on error). (nielsdos)
14+
15+
- Date:
16+
. Fixed bug GH-14709 DatePeriod::__construct() overflow on recurrences.
17+
(David Carlier)
18+
19+
- DBA:
20+
. Skip test if inifile is disabled. (orlitzky)
21+
22+
- DOM:
23+
. Fixed bug GH-17224 (UAF in importNode). (nielsdos)
24+
25+
- Embed:
26+
. Make build command for program using embed portable. (dunglas)
27+
28+
- FFI:
29+
. Fixed bug #79075 (FFI header parser chokes on comments). (nielsdos)
30+
. Fix memory leak on ZEND_FFI_TYPE_CHAR conversion failure. (nielsdos)
31+
. Fixed bug GH-16013 and bug #80857 (Big endian issues). (Dmitry, nielsdos)
32+
33+
- Filter:
34+
. Fixed bug GH-16944 (Fix filtering special IPv4 and IPv6 ranges, by using
35+
information from RFC 6890). (Derick)
36+
37+
- FPM:
38+
. Fixed bug GH-13437 (FPM: ERROR: scoreboard: failed to lock (already
39+
locked)). (Jakub Zelenka)
40+
. Fixed bug GH-17112 (Macro redefinitions). (cmb, nielsdos)
41+
. Fixed bug GH-17208 (bug64539-status-json-encoding.phpt fail on 32-bits).
42+
(nielsdos)
43+
44+
- GD:
45+
. Fixed bug GH-16255 (Unexpected nan value in ext/gd/libgd/gd_filter.c).
46+
(nielsdos, cmb)
47+
. Ported fix for libgd bug 276 (Sometimes pixels are missing when storing
48+
images as BMPs). (cmb)
49+
50+
- Gettext:
51+
. Fixed bug GH-17202 (Segmentation fault ext/gettext/gettext.c
52+
bindtextdomain()). (Michael Orlitzky)
53+
54+
- Iconv:
55+
. Fixed bug GH-17047 (UAF on iconv filter failure). (nielsdos)
56+
57+
- LDAP:
58+
. Fixed bug GH-17280 (ldap_search() fails when $attributes array has holes).
59+
(nielsdos)
60+
61+
- LibXML:
62+
. Fixed bug GH-17223 (Memory leak in libxml encoding handling). (nielsdos)
63+
64+
- MBString:
65+
. Fixed bug GH-17112 (Macro redefinitions). (nielsdos, cmb)
66+
67+
- Opcache:
68+
. opcache_get_configuration() properly reports jit_prof_threshold. (cmb)
69+
. Fixed bug GH-17246 (GC during SCCP causes segfault). (Dmitry)
70+
71+
- PCNTL:
72+
. Fix memory leak in cleanup code of pcntl_exec() when a non stringable
73+
value is encountered past the first entry. (Girgias)
74+
75+
- PgSql:
76+
. Fixed bug GH-17158 (pg_fetch_result Shows Incorrect ArgumentCountError
77+
Message when Called With 1 Argument). (nielsdos)
78+
. Fixed further ArgumentCountError for calls with flexible
79+
number of arguments. (David Carlier)
80+
81+
- Phar:
82+
. Fixed bug GH-17137 (Segmentation fault ext/phar/phar.c). (nielsdos)
83+
84+
- SimpleXML:
85+
. Fixed bug GH-17040 (SimpleXML's unset can break DOM objects). (nielsdos)
86+
. Fixed bug GH-17153 (SimpleXML crash when using autovivification on
87+
document). (nielsdos)
88+
89+
- Sockets:
90+
. Fixed bug GH-16276 (socket_strerror overflow handling with INT_MIN).
91+
(David Carlier / cmb)
92+
. Fixed overflow on SO_LINGER values setting, strengthening values check
93+
on SO_SNDTIMEO/SO_RCVTIMEO for socket_set_option().
94+
(David Carlier)
95+
96+
- SPL:
97+
. Fixed bug GH-17225 (NULL deref in spl_directory.c). (nielsdos)
98+
99+
- Streams:
100+
. Fixed bug GH-17037 (UAF in user filter when adding existing filter name due
101+
to incorrect error handling). (nielsdos)
102+
. Fixed bug GH-16810 (overflow on fopen HTTP wrapper timeout value).
103+
(David Carlier)
104+
. Fixed bug GH-17067 (glob:// wrapper doesn't cater to CWD for ZTS builds).
105+
(cmb)
106+
107+
- Windows:
108+
. Hardened proc_open() against cmd.exe hijacking. (cmb)
109+
110+
- XML:
111+
. Fixed bug GH-1718 (unreachable program point in zend_hash). (nielsdos)
112+
3113
19 Dec 2024, PHP 8.3.15
4114

5115
- Calendar:

Zend/Optimizer/zend_optimizer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ bool zend_optimizer_replace_by_const(zend_op_array *op_array,
639639
case ZEND_SWITCH_LONG:
640640
case ZEND_SWITCH_STRING:
641641
case ZEND_MATCH:
642+
case ZEND_MATCH_ERROR:
642643
case ZEND_JMP_NULL: {
643644
zend_op *end = op_array->opcodes + op_array->last;
644645
while (opline < end) {
@@ -651,6 +652,7 @@ bool zend_optimizer_replace_by_const(zend_op_array *op_array,
651652
&& opline->opcode != ZEND_SWITCH_LONG
652653
&& opline->opcode != ZEND_SWITCH_STRING
653654
&& opline->opcode != ZEND_MATCH
655+
&& opline->opcode != ZEND_MATCH_ERROR
654656
&& opline->opcode != ZEND_JMP_NULL
655657
&& (opline->opcode != ZEND_FREE
656658
|| opline->extended_value != ZEND_FREE_ON_RETURN);

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
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

Zend/zend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#ifndef ZEND_H
2121
#define ZEND_H
2222

23-
#define ZEND_VERSION "4.3.15"
23+
#define ZEND_VERSION "4.3.16"
2424

2525
#define ZEND_ENGINE_3
2626

Zend/zend_API.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2816,7 +2816,14 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend
28162816
}
28172817
internal_function->type = ZEND_INTERNAL_FUNCTION;
28182818
internal_function->module = EG(current_module);
2819-
internal_function->T = 0;
2819+
if (EG(active) && ZEND_OBSERVER_ENABLED) {
2820+
/* Add an observer temporary to store previous observed frames. This is
2821+
* normally handled by zend_observer_post_startup(), except for
2822+
* functions registered at runtime (EG(active)). */
2823+
internal_function->T = 1;
2824+
} else {
2825+
internal_function->T = 0;
2826+
}
28202827
memset(internal_function->reserved, 0, ZEND_MAX_RESERVED_RESOURCES * sizeof(void*));
28212828

28222829
while (ptr->fname) {

Zend/zend_API.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1482,7 +1482,10 @@ static zend_always_inline zval *zend_try_array_init_size(zval *zv, uint32_t size
14821482
}
14831483
zv = &ref->val;
14841484
}
1485-
zval_ptr_dtor(zv);
1485+
zval garbage;
1486+
ZVAL_COPY_VALUE(&garbage, zv);
1487+
ZVAL_NULL(zv);
1488+
zval_ptr_dtor(&garbage);
14861489
ZVAL_ARR(zv, arr);
14871490
return zv;
14881491
}

Zend/zend_ast.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2444,6 +2444,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
24442444
if (ast->child[3]) {
24452445
zend_ast_export_attributes(str, ast->child[3], indent, 0);
24462446
}
2447+
zend_ast_export_visibility(str, ast->attr);
24472448
if (ast->child[0]) {
24482449
zend_ast_export_type(str, ast->child[0], indent);
24492450
smart_str_appendc(str, ' ');

Zend/zend_execute_API.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,11 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_
838838
ZEND_CALL_NUM_ARGS(call) = i;
839839
cleanup_args:
840840
zend_vm_stack_free_args(call);
841+
if (ZEND_CALL_INFO(call) & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS) {
842+
zend_free_extra_named_params(call->extra_named_params);
843+
}
841844
zend_vm_stack_free_call_frame(call);
845+
zend_release_fcall_info_cache(fci_cache);
842846
return SUCCESS;
843847
}
844848
}

0 commit comments

Comments
 (0)