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

135876 Commits

Author SHA1 Message Date
Jakub Zelenka
7791bc69c5 Update versions for PHP 8.3.26 php-8.3.26 2025-09-23 19:57:26 +02:00
Remi Collet
d2fa1ca600 Mark test as ONLINE (#19776) 2025-09-09 16:34:02 +02:00
Alexandre Daubois
9eedf00206 Fix intl tests naming (#19763) 2025-09-09 08:41:20 +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
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
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
6a2adcd8a4 Fix GH-11952: better locale strings canonicalization for IntlDateFormatter and NumberFormatter (#19593) 2025-09-08 16:36:27 +02: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
2f162214e8 Fix memory leak in phar tar temporary file error handling code
Closes GH-19740.
2025-09-07 13:04:19 +02:00
George Wang
ebbed484fb update LiteSpeed API to V8.3 2025-09-06 12:46:56 -04:00
George Wang
aa3983b31b fix pipe detection for STDERR. 2025-09-06 12:44:54 -04: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
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
0e668e517a Fix NEWS entry order 2025-09-05 10:53:22 +02:00
Alexandre Daubois
a41cb62c4c Fix GH-19461: Improve error message on listening error with IPv6 (#19462) 2025-09-05 10:48:33 +02:00
Remi Collet
abbf84083a NEWS 2025-09-05 09:12:07 +02:00
Remi Collet
98d2b92324 Fix GH-19681 PHP_EXPAND_PATH broken with bash 5.3.0 2025-09-05 09:08:15 +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
d10ff9bbd8 Remove incorrect call to zval_ptr_dtor() in user_wrapper_metadata()
This one is not initialized. This is not hittable from userspace code
because all locations within first-party php-src code have a valid
`option` argument.

Closes GH-19714.
2025-09-04 23:13:20 +02:00
Arnaud Le Blanc
bd88a54934 Ensure that type widening converges
Range analysis may fail to converge (the process hangs) when the transfer
function zend_inference_calc_range produces a smaller range.

Fix by ensuring that the widening operator zend_inference_widening_meet
allows only widening. This matches the inference rules in figure 13 of the
paper.

Fixes GH-19679
Closes GH-19683
2025-09-04 08:58:06 +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
f9ce6d8f3a Stale array iterator pointer
Fixes GH-19613
Closes GH-19616
2025-09-03 18:14:43 +02:00
Ilija Tovilo
15beb140e5 Fix RC assertion in fpm when php_admin_value setting fails
The value is temporarily duplicated. While the value is allocated persistently,
it will be freed if the ini value can't be set. This is safe, given the value
has not actually been stored.

Exposed by GH-19619
Closes GH-19671
2025-09-03 14:49:06 +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
Jakub Zelenka
6194084837 Use the default OpenSSL version for MacOS to match libs
This seems like an issue that might be potentially causing issues like
GH-12901. The problem is that libs like libcurl, libldap and others use
the default OpenSSL version so this might result in linking issues.

The fact that OpenSSL 1.1.1 was actually good that we were able to have
it in the pipeline but this is just not right setup so we should find
another way how to test it at least in nightly.

Closes GH-19472
2025-09-01 23:06:39 +02:00
Tim Düsterhus
96c0bc55bb NEWS for d74901ae1a
NEWS was missing for 8.3, but was in 8.4:
62e30ecae1
2025-08-25 09:19:01 +02:00
Gina Peter Banyard
e46f77c861 Update NEWS for Phar memory leak fix 2025-08-23 15:27:01 +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
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
Ilija Tovilo
0a12aaa5b8 Fix signed int overflow in scanner
yylen is unsigned int, but len in zend_scan_escape_string() is int, which will
break for string literals >=2GB. yyleng is still limited to 4GB, but we can't
fix this without breaking the ABI.

Partially addresses GH-19542
Closes GH-19545
2025-08-22 16:24:20 +02: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
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
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
Tim Düsterhus
fdd27472de Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Update GitHub Action workflows to `actions/checkout@v5`
2025-08-13 19:08:30 +02:00
Tim Düsterhus
aa992f36d3 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Update GitHub Action workflows to `actions/checkout@v5`
2025-08-13 19:08:06 +02:00
Tim Düsterhus
2650248a92 Update GitHub Action workflows to actions/checkout@v5
Keep this up to date in all non-security-only branches, because the node.js
runtime for older versions might get deprecated in the future and fixing this
for all branches at once is easier.

see 45e60e585e
2025-08-13 19:06:09 +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
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
Eric Mann
a0bd2c9fcf PHP-8.3 is now for PHP 8.3.26-dev 2025-08-12 08:15:40 -07:00
Ilija Tovilo
347723af05 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Add timeout for FreeBSD
2025-08-12 14:18:53 +02:00
Ilija Tovilo
0c044b35b7 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Add timeout for FreeBSD
2025-08-12 14:18:44 +02:00
Ilija Tovilo
abb7f2879e [skip ci] Add timeout for FreeBSD
Unfortunately, these jobs routinely fail to boot correctly. In this case,
they'll stall and block CI for 6 hours until they finally fail. Add a limit to
make them fail earlier.
2025-08-12 14:17:33 +02:00
Niels Dossche
9b86533ce4 Fix GH-19065: Long match statement can segfault compiler during recursive SSA renaming
On some systems, like Alpine, the thread stack size is small by default.
The last step of SSA construction involves variable renaming that is
recursive, and also makes copies of their version of the renamed
variables on the stack. This combination causes a stack overflow during
compilation on Alpine. Triggerable for example with very long match
statements.

A stop-gap solution would be to use heap allocated arrays for the
renamed variable list, but that would only delay the error as increasing
the number of match arms increases the depth of the dominator tree, and
will eventually run into the same issue.

This patch transforms the algorithm into an iterative one.
There are two states stored in a worklist stack: positive numbers
indicate that the block still needs to undergo variable renaming.
Negative numbers indicate that the block and its dominated children are
already renamed. Because 0 is also a valid block number, we bias the
block numbers by adding 1.
To restore to the right variant when backtracking the "recursive" step,
we index into an array pointing to the different variable renaming
variants.

Closes GH-19083.
2025-08-11 23:05:21 +02:00
Niels Dossche
b57578f3b1 Fix GH-19383: php-8.3.24: Missing type in function definition: fpm_event_kqueue_clean
This is just a clean backport.
2025-08-10 13:25:24 +02:00
Jakub Zelenka
9e2aa658a8 Fix GH-19428: openssl_pkey_derive segfaults for DH derive with low key_length
This happens only for OpenSSL 1.1.1 because key_length is ignored for
DH. It means that the provided string is overwritten with longer buffer.
2025-08-09 17:43:04 +02:00
Niels Dossche
cc93bbb765 Fix GH-19397: mb_list_encodings() can cause crashes on shutdown
The request shutdown does not necessarily hold the last reference, if
there is still a CV that refers to the array.

Closes GH-19405.
2025-08-08 20:32:29 +02:00
Niels Dossche
5cf45ba5ab Fix GH-19371: integer overflow in calendar.c
Closes GH-19380.
2025-08-07 19:08:32 +02:00
Ilija Tovilo
aae35f3617 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix ERROR_CODE handling in COMMUNITY build
2025-08-07 13:56:06 +02:00
Ilija Tovilo
080ba20d49 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix ERROR_CODE handling in COMMUNITY build
2025-08-07 13:55:59 +02:00