1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Commit Graph

69193 Commits

Author SHA1 Message Date
Alexandre Daubois
f9805eb14b Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix intl tests naming (#19763)
2025-09-09 08:42:10 +02:00
Alexandre Daubois
b718514dc2 Fix memory leak when providing an invalid locale to IntlDateFormatter (#19764) 2025-09-09 08:41:32 +02:00
Alexandre Daubois
9eedf00206 Fix intl tests naming (#19763) 2025-09-09 08:41:20 +02:00
Niels Dossche
c395355728 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19752: Phar decompression with invalid extension can cause UAF
2025-09-08 23:11:01 +02:00
Niels Dossche
f6878b6ccf Fix GH-19752: Phar decompression with invalid extension can cause UAF
The rename code can error out prior to the reassignment of the filename,
which is why the test causes a crash.
The rename code can also error out at a later point,
which means it will have already assigned the new filename.
We detect in which case we are in and act accordingly.

Closes GH-19761.
2025-09-08 23:10:33 +02:00
Niels Dossche
89f2805905 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix OSS-Fuzz #385993744
2025-09-08 19:10:41 +02:00
Niels Dossche
ff84cb08ef Fix OSS-Fuzz #385993744
PSFS_FEED_ME is supposed to be returned when the filter did not receive
enough data and did not generate buckets for the output brigade.
The test generates buckets anyway on the output brigade, and the stream
layer did not handle that case causing a memory leak.
To solve this, discard any such buckets as it would conflict with the
status code returned by the filter. This keeps BC and solves the leak.

Closes GH-18972.
2025-09-08 19:10:22 +02:00
Niels Dossche
10a2a2a368 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix memory leak on failure in phar_convert_to_other()
  Fix metadata leak when phar convert logic fails
2025-09-08 19:06:37 +02:00
Niels Dossche
98bb934685 Fix memory leak on failure in phar_convert_to_other()
Closes GH-19755.
2025-09-08 19:06:11 +02:00
Niels Dossche
c50b37d231 Fix metadata leak when phar convert logic fails
Closes GH-19756.
2025-09-08 19:05:47 +02:00
Alexandre Daubois
cc4cfbf984 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-11952: better locale strings canonicalization for IntlDateFormatter and NumberFormatter (#19593)
2025-09-08 16:38:31 +02:00
Alexandre Daubois
6a2adcd8a4 Fix GH-11952: better locale strings canonicalization for IntlDateFormatter and NumberFormatter (#19593) 2025-09-08 16:36:27 +02:00
David Carlier
a0b7dab64b Merge branch 'PHP-8.3' into PHP-8.4 2025-09-07 18:19:08 +01:00
David Carlier
93865a4086 Fix GH-19578: imagefilledellipse underflow on width argument.
close GH-19579
2025-09-07 18:18:17 +01:00
Niels Dossche
3d52e925a1 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix memory leak in phar tar temporary file error handling code
2025-09-07 13:05:07 +02:00
Niels Dossche
2f162214e8 Fix memory leak in phar tar temporary file error handling code
Closes GH-19740.
2025-09-07 13:04:19 +02:00
Niels Dossche
f744c827a8 Fix GH-19706: dba stream resource mismanagement
This regressed in 8.4 when dba started mixing objects and resources
(streams).
The streams are first destroyed at a first step in shutdown, and in slow
shutdown then the symbol table is destroyed which destroys the dba
objects. The dba objects still use the streams but they have been
destroyed already, causing a UAF. Using dtor_obj instead of free_obj
would work around this but would cause issues like memory leaks because
dtor_obj may be skipped while free_obj may not be.
Instead, use the same solution as mysqlnd uses in that we fully manage
the stream lifecycle ourselves. This also avoids users from meddling
with the stream through get_resources().
This would be fixed 'automatically' in the future when we are using
objects for everything.

Closes GH-19710.
2025-09-06 00:08:15 +02:00
Niels Dossche
c58312462c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19720: Assertion failure when error handler throws when accessing a deprecated constant
2025-09-06 00:01:13 +02:00
Niels Dossche
9d69ab91ab Fix GH-19720: Assertion failure when error handler throws when accessing a deprecated constant
When deprecation causes an exception, we should return NULL instead of
continuing.

Closes GH-19723.
2025-09-06 00:00:52 +02:00
Niels Dossche
1b49d0eb58 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix memory leak in zip when encountering empty glob result
2025-09-05 18:57:26 +02:00
Niels Dossche
216e87ad7e Fix memory leak in zip when encountering empty glob result
The case of returning 0 is inconsistent in when it returns an empty
array, furthermore the caller already returns an empty array.
Because the caller overwrites the return value in these cases, it can
cause a memory leak.

This is easier to trigger on master in some cases as different code paths
are taken with the new bundled glob. On some platforms it is also
triggerable on 8.3.

Closes GH-19715.
2025-09-05 18:56:27 +02:00
Alexandre Daubois
7cceda1597 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19577: avoid integer overflow when using a small offset and PHP_INT_MAX with LimitIterator (#19585)
2025-09-05 08:10:22 +02:00
Alexandre Daubois
05133ac962 Fix GH-19577: avoid integer overflow when using a small offset and PHP_INT_MAX with LimitIterator (#19585) 2025-09-05 08:09:06 +02:00
Niels Dossche
3023b29a11 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19612: Mitigate libxml2 tree dictionary bug
2025-09-03 21:58:16 +02:00
Niels Dossche
080fd14458 Fix GH-19612: Mitigate libxml2 tree dictionary bug
This code is very similar to code on PHP 8.4 and higher, but the
mitigation is extended to entity references and to attribute children.

Closes GH-19620.
2025-09-03 21:52:48 +02:00
Ilija Tovilo
73fc2db234 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix date_sunrise() and date_sunset() with partial-hour UTC offset
2025-09-03 13:35:04 +02:00
Ilija Tovilo
0ae9a58ade Fix date_sunrise() and date_sunset() with partial-hour UTC offset
See GH-19633
Closes GH-19672
2025-09-03 13:34:03 +02:00
Dmitry Stogov
d59ae9345c Cleanup SSA(s) in case of fatal error during tracing JIT
This fixes segfault becuse of UAF in ext/standard/tests/gh14643_longname.phpt
2025-09-02 10:04:40 +03:00
Dmitry Stogov
93740d0a82 Update IR
IR commit: 3d7ac467fc89c136866f11195355789d9850de9f
2025-09-02 10:01:52 +03:00
Niels Dossche
3690df022b Fix Windows build 2025-08-25 00:23:09 +02:00
Niels Dossche
c66af62511 Sync lexbor with master on PHP 8.4 2025-08-25 00:06:18 +02:00
Gina Peter Banyard
20c274b688 Merge branch 'PHP-8.3' into PHP-8.4 2025-08-23 15:27:25 +02:00
Gina Peter Banyard
f5a3a642c6 ext/phar: Fix memory leaks when verifying OpenSSL signature (#19563) 2025-08-23 14:25:42 +01:00
Arnaud Le Blanc
62e30ecae1 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Differenciate WeakMaps from bare HashTables used as weak maps for GC purposes
2025-08-22 16:33:08 +02:00
Arnaud Le Blanc
d74901ae1a Differenciate WeakMaps from bare HashTables used as weak maps for GC purposes
Since cbf67e4, the GC needs to find all WeakMaps referencing a weakly
referenced object. Doing so, it treats all ZEND_WEAKREF_TAG_MAP as WeakMap
instances.

However, a ZEND_WEAKREF_TAG_MAP reference may be a bare HashTable when
zend_weakrefs_hash_add() is used.

Introduce a new tag, ZEND_WEAKREF_TAG_BARE_HT, and use this tag when weakly
referencing an object from a bare HashTable. Ignore such references in GC.

Fixes GH-19543
Closes GH-19544

Co-authored-by: Tim Düsterhus <tim@tideways-gmbh.com>
2025-08-22 16:32:30 +02:00
Arnaud Le Blanc
bc05bfe7c5 Fit JIT variable not stored before YIELD
JIT doesn't recognize that variables may be used after returning from a
trace due to YIELD, so some effects may never be stored to memory.

YIELD ops terminate trace recordings with ZEND_JIT_TRACE_STOP_RETURN, and are
handled mostly like RETURN. Here I change zend_jit_trace_execute() so that
YIELD terminates recordings with ZEND_JIT_TRACE_STOP_INTERPRETER instead,
to ensure that we recognize that variables may be used after returning from
the trace due to YIELD.

Fixes GH-19493
Closes GH-19515
2025-08-19 15:49:29 +02:00
David Carlier
0fc3a2e624 Merge branch 'PHP-8.3' into PHP-8.4 2025-08-16 19:28:00 +01:00
Arjen de Korte
a97717d23e Fix GH-19021: deprecation for tidyOptIsReadOnly
The tidyOptGetCategory function (added in libtidy 5.4.0) if only useable if TidyInternalCategory (added in libtidy 5.6.0) is also present, so check for the latter instead.

close GH-19053
2025-08-16 19:24:47 +01:00
David Carlier
fd4db3e178 Merge branch 'PHP-8.3' into PHP-8.4 2025-08-15 08:05:14 +01:00
Mark Karpeles
987a3a5c8e Fix GH-19484 i: potential use after free when using persistent pgsql connections.
By setting the notice processor to a no-op when a persistent connection is cleaned for future use.

Close GH-19485
2025-08-15 08:04:14 +01:00
Ilija Tovilo
708d8e9cfd Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix "Constant already defined" warning with repeated inclusion of file with __halt_compiler()
2025-08-14 12:15:00 +02:00
Ilija Tovilo
a3de2ce9ba Fix "Constant already defined" warning with repeated inclusion of file with __halt_compiler()
Fixes GH-18850
Closes GH-19471
2025-08-14 12:13:50 +02:00
Dmitry Stogov
cbb9ee8f5b Added test for PR #19458
Thanks to @DanielEScherzer
2025-08-13 15:58:04 +03:00
Ilija Tovilo
7e01cf59bb Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16649: Avoid UAF when using array_splice
2025-08-13 14:16:12 +02:00
Alexandre Daubois
c8774f9e61 Fix GH-16649: Avoid UAF when using array_splice
Closes GH-19399
2025-08-13 14:15:34 +02:00
Jakub Zelenka
c8a4207400 Merge branch 'PHP-8.3' into PHP-8.4 2025-08-12 17:29:18 +02:00
Jakub Zelenka
2b415e416e Fix GH-19245: Success error message on TLS stream accept failure
This overwrites the previous message from the successful accept call.

Closes GH-19246
2025-08-12 17:28:33 +02:00
Dmitry Stogov
47f9f3a3f6 Fix Nightly workflow Symfony assertion (ir_ra.c:326: ir_fix_live_range: Assertion `ival && p->start == old_start' failed) (#19458) 2025-08-12 11:59:08 +03:00
Niels Dossche
91665eaa63 Backport Lexbor changes to 8.4 2025-08-10 14:17:19 +02:00
Jakub Zelenka
f52a59ff4f Merge branch 'PHP-8.3' into PHP-8.4 2025-08-09 17:44:25 +02:00