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

138304 Commits

Author SHA1 Message Date
Christoph M. Becker
37561823e9 Fix GH-16367: macOS CI fails to configure ext/intl on master
Closes GH-16375.
2024-10-11 23:10:29 +02:00
David Carlier
be370edbd7 Merge branch 'PHP-8.3' into PHP-8.4 2024-10-11 19:38:39 +01:00
David Carlier
d612b0a124 Merge branch 'PHP-8.2' into PHP-8.3 2024-10-11 19:38:26 +01:00
David Carlier
f2859a4050 Fix GH-16322: imageaffine overflow on affine argument.
close GH-16334
2024-10-11 19:37:34 +01:00
David Carlier
f47a45ecff Merge branch 'PHP-8.3' into PHP-8.4 2024-10-11 08:49:00 +01:00
David Carlier
89b4f94024 Merge branch 'PHP-8.2' into PHP-8.3 2024-10-11 08:48:49 +01:00
David Carlier
c34d4fbbf4 Fix GH-16360 mb_substr overflow on start and length arguments.
occurs when they are negated to start working from the end instead
when set with ZEND_LONG_MIN.
2024-10-11 08:46:48 +01:00
Niels Dossche
5b0b151bb2 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16168: php 8.1 and earlier crash immediately when compiled with Xcode 16 clang on macOS 15
2024-10-11 09:14:26 +02:00
Niels Dossche
e4a23e920d Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16168: php 8.1 and earlier crash immediately when compiled with Xcode 16 clang on macOS 15
2024-10-11 09:14:10 +02:00
Niels Dossche
e2e2b3ab62 Fix GH-16168: php 8.1 and earlier crash immediately when compiled with Xcode 16 clang on macOS 15
The inline assembly uses labels with the prefix `.L`. On Linux systems
this is the local label prefix. It appears that macOS uses `L` as a
local prefix, which means that the prefix used in the inline assembly is not
local for macOS systems [1].
When combined with inlining, this causes the compiler to get confused
and merge a part of the inline assembly between different functions,
causing control flow to jump from one function to another function.
This is avoided on PHP 8.2 and up by the fact that it
uses `zend_never_inline NOIPA`, but nothing guarantees that compiler
changes won't affect this as well.

To solve this issue, we instead use local labels. These will make the
compiler pick the correct prefix, preventing the issue.

Additionally, while here, we also change the computation of `delta`.
It is undefined behaviour to compute the pointer difference between
two different objects. To circumvent this, we cast first to `uintptr_t`.

This change is cleanly backportable to 8.1 for vendors to pick up.

[1] https://github.com/php/php-src/issues/16168#issuecomment-2404792553

With the help of investigation and testing of @ryandesign.

Closes GH-16348.
2024-10-11 09:09:05 +02:00
Niels Dossche
e0b1b693e3 Fix OSS-Fuzz #371445205: Heap-use-after-free in attr_free
zend_hash_get_current_key() does not return a string with incremented
refcount, so it shouldn't get released. This release caused a UAF later
when the attribute was destroyed. This wasn't noticed earlier because
object_init_with_constructor() was only ever tested with interned
strings.

Closes GH-16349.
2024-10-11 09:07:08 +02:00
Niels Dossche
25d0661d21 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16316: DOMXPath breaks when not initialized properly
2024-10-10 19:29:16 +02:00
Niels Dossche
5ae792715e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16316: DOMXPath breaks when not initialized properly
2024-10-10 19:28:53 +02:00
Niels Dossche
1d0fbdf449 Fix GH-16316: DOMXPath breaks when not initialized properly
Closes GH-16330.
2024-10-10 19:28:20 +02:00
Christoph M. Becker
279e952159 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Allow to run push workflows manually
2024-10-10 02:13:57 +02:00
Christoph M. Becker
80477b15cf Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Allow to run push workflows manually
2024-10-10 02:13:19 +02:00
Christoph M. Becker
509fec8ee6 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Allow to run push workflows manually
2024-10-10 02:12:26 +02:00
Christoph M. Becker
0b5167cff5 [skip ci] Allow to run push workflows manually
As is, we're running the push workflow for all pushes and pull request,
plus we run more comprehensive nightly workflow for all branches which
had commits during the day.  That means that security branches may not
run CI for weeks or even months.  In the meantime, dependencies might
be updated, which can cause later workflow runs to fail.  For instance,
a few openssl tests fail due to security fixes in OpenSSL[1], an update
of Oracle Instant Client causes a couple of oci8 and pdo_oci tests to
fail[2], and the macOS builds do no longer even built (investigation
pending).

Therefore, we allow to run the pull workflow manually, so it is
possible to check the CI condition of temporary inactive branches from
time to time.

[1] <https://github.com/php/php-src/pull/16097>
[2] <https://github.com/php/php-src/pull/16107>

Closes GH-16148.
2024-10-10 02:11:59 +02:00
Christoph M. Becker
980d41cb3a Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16174: Empty string is an invalid expression for phpdbg-ev
2024-10-10 01:47:23 +02:00
Christoph M. Becker
5c6fc09e45 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16174: Empty string is an invalid expression for phpdbg-ev
2024-10-10 01:46:30 +02:00
Christoph M. Becker
6bcba24eb0 Fix GH-16174: Empty string is an invalid expression for phpdbg-ev
Strings may be empty, so we must not assume they are not.

Closes GH-16177.
2024-10-10 01:45:37 +02:00
Christoph M. Becker
7bf3f708d5 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Revert "Fix GH-16322: overflow on imageaffine matrix argument."
2024-10-10 01:15:52 +02:00
Christoph M. Becker
b36170fde8 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Revert "Fix GH-16322: overflow on imageaffine matrix argument."
2024-10-10 01:14:18 +02:00
Christoph M. Becker
07f1b5a414 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Revert "Fix GH-16322: overflow on imageaffine matrix argument."
  Fix GH-16322: overflow on imageaffine matrix argument.
2024-10-10 00:59:58 +02:00
Christoph M. Becker
3599b80f0f Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Revert "Fix GH-16322: overflow on imageaffine matrix argument."
  Fix GH-16322: overflow on imageaffine matrix argument.
2024-10-10 00:58:51 +02:00
Christoph M. Becker
9b64d3212d Revert "Fix GH-16322: overflow on imageaffine matrix argument."
This reverts commit 05114265fb, since it
apparently has been pushed inadvertently (see PR #16334).
2024-10-10 00:58:12 +02:00
David Carlier
93a2fe8aac Revert "Fix GH-16322: overflow on imageaffine matrix argument."
This reverts commit 05114265fb.
2024-10-09 23:57:09 +01:00
David Carlier
05114265fb Fix GH-16322: overflow on imageaffine matrix argument. 2024-10-09 23:18:23 +01:00
Christoph M. Becker
42a2b046fe Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix out of bound writes to SafeArray data
2024-10-09 21:16:29 +02:00
Christoph M. Becker
edb0af6f10 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix out of bound writes to SafeArray data
2024-10-09 21:15:35 +02:00
Christoph M. Becker
1ee56bdd5a Fix out of bound writes to SafeArray data
Converting PHP arrays to Variants originally supported almost arbitrary
numeric arrays, possibly filling gaps with NULL values.  This is broken
as of PHP 7.0.0[1] so that the SafeArray only has as many elements as
the PHP array.  Thus, unless the array is a list, some elements may be
written outside of the SafeArray data.

To avoid breaking userland code after that long time, we do not restore
the original behavior, but instead only suppress the erroneous writes.

To avoid the need to split the regression test for 32bit and 64bit
Windows, we suppress the "max number 4294967295 of elements in safe
array exceeded" warning, which only occurs for 64bit versions.

[1] <c865472ef0>

Closes GH-16309.
2024-10-09 21:14:44 +02:00
Tim Düsterhus
f2fbb75f30 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  curl: Prevent a CurlMultiHandle from holding onto a CurlHandle if `add_handle` fails (#16302)
2024-10-09 09:38:16 +02:00
Tim Düsterhus
a1e96620f2 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  curl: Prevent a CurlMultiHandle from holding onto a CurlHandle if `add_handle` fails (#16302)
2024-10-09 09:37:50 +02:00
Tim Düsterhus
e49d732a83 curl: Prevent a CurlMultiHandle from holding onto a CurlHandle if add_handle fails (#16302)
* curl: Prevent a CurlMultiHandle from holding onto a CurlHandle if `add_handle` fails

As a user I expect `curl_multi_add_handle` to not have any effect if it returns
an error and I specifically do not expect that it would be necessary to call
`curl_multi_remove_handle`.

* NEWS
2024-10-09 09:37:13 +02:00
Niels Dossche
1f84f5c27a Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16292: Segmentation fault in ext/xmlreader/php_xmlreader.c:1282
2024-10-08 20:58:20 +02:00
Niels Dossche
54eab7b3cf Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16292: Segmentation fault in ext/xmlreader/php_xmlreader.c:1282
2024-10-08 20:57:54 +02:00
Niels Dossche
5c1249391b Fix GH-16292: Segmentation fault in ext/xmlreader/php_xmlreader.c:1282
3 issues:
1) RETURN_NULL() was used via the macro NODE_GET_OBJ(), but the function
   returns false on failure and cannot return null according to its
   stub.
2) The struct layout of the different implementors of libxml only
   guarantees overlap between the node pointer and the document
   reference, so accessing the std zend_object may not work.
3) DOC_GET_OBJ() wasn't using ZSTR_VAL().

Closes GH-16307.
2024-10-08 20:54:07 +02:00
Jakub Zelenka
3bb06bc728 Merge branch 'PHP-8.3' into PHP-8.4 2024-10-08 19:22:44 +01:00
Jakub Zelenka
6f868bd6db PHP-8.3 is now for PHP-8.3.14-dev 2024-10-08 19:21:43 +01:00
Niels Dossche
98e5308488 Update Lexbor (#16288)
Sync up to lexbor/lexbor@72236d31da.
Reason: pulling in mainly
lexbor/lexbor@cbf1263e78 for the WHATWG
encoding update.
2024-10-08 19:15:45 +02:00
Sergey Panteleev
564db544bb Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  PHP-8.2 is now for PHP 8.2.26-dev
2024-10-08 19:56:14 +05:00
Sergey Panteleev
67af5b55aa Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  PHP-8.2 is now for PHP 8.2.26-dev

# Conflicts:
#	Zend/zend.h
#	configure.ac
#	main/php_version.h
2024-10-08 19:56:00 +05:00
Sergey Panteleev
5f5824015c PHP-8.2 is now for PHP 8.2.26-dev 2024-10-08 19:53:22 +05:00
Calvin Buckley
7f2d1928cd [ci skip] Update NEWS for PHP 8.4.0RC2 2024-10-08 10:59:50 -03:00
Calvin Buckley
4643386703 Fix regression on platforms without ZEND_CHECK_STACK_LIMIT set (8.4) (#16285)
The check called an API only available with this def set.
Gate the check behind ifdef and change control flow to better fit it.

Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
2024-10-08 10:22:23 -03:00
Ilija Tovilo
d76ef13757 Fix various hooked object iterator issues
Fixes GH-16185
Closes GH-16281
2024-10-08 13:35:33 +02:00
Dmitry Stogov
3fcf8caca8 Update IR
IR commit: 88c71c9572bdd9dd8aed99c80ad4a54fcbcfe082
2024-10-07 21:18:35 +03:00
Christoph M. Becker
626dc50989 Fix PDO_Firebird tests for 32bit
These tests are failing because the integers are too large to be cast
to a PHP int.  We fix this by expecting either an int or a string.

Closes GH-16278.
2024-10-07 19:52:39 +02:00
Arnaud Le Blanc
6f70cd3f04 NEWS for GH-16200 2024-10-07 18:19:26 +02:00
Arnaud Le Blanc
82f70dba7d Use original op_array when JIT compiling a Closure
zend_jit() assumes that Closure op_arrays have no scope, but this is not true
when using the hot counters, first exec, or trace triggers as they use the
executed op_array, which is in case of Closures is a copy, with a scope.

In the tracing JIT this problem is avoided as we fetch the original op_array
when compiling a Closure. Here I replicate this for the hot counters and first
exec triggers.

Fixes GH-16186
Closes GH-16200
2024-10-07 18:06:14 +02:00