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

135891 Commits

Author SHA1 Message Date
Niels Dossche
2ad0b5cf05 Fix GH-19792: SCCP causes UAF for return value if both warning and exception are triggered
If an exception _and_ a warning (or deprecation) is emitted, then the
result is destroyed twice. Use an `else if` to prevent this.
This is tested via zend_test because the deprecation that triggered the
original reproducer may disappear in the future.

Closes GH-19793.
2025-09-11 19:35:53 +02:00
Ilija Tovilo
d30ec1df2a Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Add --enable-zend-max-execution-timers to variation nightly build
2025-09-11 15:00:16 +02:00
Ilija Tovilo
78dd5cefd0 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Add --enable-zend-max-execution-timers to variation nightly build
2025-09-11 15:00:08 +02:00
Ilija Tovilo
be5b2bf4b8 [skip ci] Add --enable-zend-max-execution-timers to variation nightly build
Only enable for 8.3 because of GH-19786.
2025-09-11 14:59:39 +02:00
Appla
ed9430a5d1 Fix hard_timeout when zend-max-execution-timers is enabled
Closes GH-19786
2025-09-11 14:49:19 +02:00
Niels Dossche
901f71e6e3 Fix GH-19688: Remove pattern overflow in zip addGlob()
memcmp() can overread the filename if the filename is shorter than the
pattern.

Closes GH-19689.
2025-09-10 23:47:52 +02:00
Niels Dossche
f6f17484ab Fix GH-12265: Cloning an object breaks serialization recursion
Closes GH-12287.
2025-09-10 17:53:34 +02:00
Jakub Zelenka
c9cc68b9ed PHP-8.3 is now for PHP-8.3.27-dev 2025-09-09 23:02:24 +02:00
Jakub Zelenka
3a17712269 Merge branch 'PHP-8.2' into PHP-8.3 2025-09-09 21:59:35 +02:00
Jakub Zelenka
6f92e9c054 Merge branch 'PHP-8.1' into PHP-8.2 2025-09-09 21:58:37 +02:00
Jakub Zelenka
c0f8bb6622 Revert "fix pipe detection for STDERR."
This reverts commit a757f276f9.
2025-09-09 21:57:54 +02:00
Tim Düsterhus
4b35b8b69b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  fix pipe detection for STDERR.
  fix pipe detection for STDERR.
2025-09-09 19:42:05 +02:00
Tim Düsterhus
4f59f371c2 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  fix pipe detection for STDERR.
2025-09-09 19:41:54 +02:00
Tim Düsterhus
215ebbb8d5 zend_API: Do not overwrite readonly properties in object_properties_load() (#19767)
Fixes php/php-src#19765.
2025-09-09 19:33:45 +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
George Wang
828080146b fix pipe detection for STDERR. 2025-09-06 12:39:53 -04:00
George Wang
a757f276f9 fix pipe detection for STDERR. 2025-09-06 12:38:13 -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