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

138693 Commits

Author SHA1 Message Date
Dmitry Stogov
6d9f040d29 Stop trace recording only on ENTER to FAKE_CLOSURE (continue on EXIT) (#16455) 2024-10-16 12:26:40 +03:00
Christoph M. Becker
99aa43a65a Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16433: Large values for openssl_csr_sign() $days overflow
2024-10-16 11:10:43 +02:00
Christoph M. Becker
ef1c3b82ff Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16433: Large values for openssl_csr_sign() $days overflow
2024-10-16 11:10:12 +02:00
Christoph M. Becker
931762c626 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16433: Large values for openssl_csr_sign() $days overflow
2024-10-16 11:09:00 +02:00
Christoph M. Becker
2bdf2f9100 Fix GH-16433: Large values for openssl_csr_sign() $days overflow
The `offset_sec` parameter of `X509_gmtime_adj()` expects a `long`, but
the `$days` parameter of `openssl_csr_sign()` a `zend_long`.  We must
avoid signed integer overflow (UB), but also must not silently truncate.
Thus we check the given `$days` for the permissible range, and bail out
otherwise.

Closes GH-16437.
2024-10-16 11:08:02 +02:00
Dmitry Stogov
097edc86c8 Allow JIT for passing arguments to trampolines and "bad" functions (#16365)
* Better trace coverage (JIT trampoline calls)

* clenup trampoline by zend_jit_free_trampoline()

* Fix ZEND_JIT_TRACE_INIT_CALL/ZEND_JIT_TRACE_DO_ICALL num_args mismatch

It may be caused by SEND_UNPACK/SEND_ARRAY

* cleanup

* cleanup

* Don't record function that may be temporary

* cleanup

* Prevent invalid run_time_cache allocation for "bad" internal functions

* Update zend_jit_trace_record_fake_init_call_ex() accordingly

* Better handling of "bad" functions and fake closures
2024-10-15 22:31:05 +03:00
Gina Peter Banyard
2d9eb54732 Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Group similar entries in UPGRADING (#16420)
2024-10-15 19:39:00 +01:00
Gina Peter Banyard
9a4ec4015a [skip ci] Group similar entries in UPGRADING (#16420)
* [skip ci] Group similar entries in UPGRADING

This groups together:
- Class constants being typed
- Resource to object conversions
- New warnings and exceptions

Drive-by wording improvements
---------

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2024-10-15 19:38:19 +01:00
Niels Dossche
5e2e49af82 Merge branch 'PHP-8.4'
* PHP-8.4:
  [ci skip] Fix UPGRADING section
2024-10-15 19:24:04 +02:00
Niels Dossche
0be5dd129e [ci skip] Fix UPGRADING section 2024-10-15 19:23:55 +02:00
Christoph M. Becker
dbdcc95c9c Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16411: gmp_export() can cause overflow
2024-10-15 16:00:26 +02:00
Christoph M. Becker
b1fbdd8a67 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16411: gmp_export() can cause overflow
2024-10-15 15:59:53 +02:00
Christoph M. Becker
ea6f78eac8 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16411: gmp_export() can cause overflow
2024-10-15 15:58:21 +02:00
Christoph M. Becker
ab595c0764 Fix GH-16411: gmp_export() can cause overflow
We need not only to avoid the signed overflow while calculating
`bits_per_word` (reported issue), but also the unsigned overflow when
calculating `count`.  While the former has a fixed threshold, the
latter does not, since it also depends on the size in base 2.  Thus we
use a somewhat unconventional error message.

Closes GH-16418.
2024-10-15 15:57:17 +02:00
Dmitry Stogov
b9a64c5e34 Fix GH-16358: Segmentation fault (access null pointer) in Zend/zend_operators.c:2495 2024-10-15 15:37:30 +03:00
Arnaud Le Blanc
23c60d6b72 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix handling of invalid iterator in zend_weakmap_iterator_get_current_key()
2024-10-15 12:24:01 +02:00
Arnaud Le Blanc
8aa32601dc Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix handling of invalid iterator in zend_weakmap_iterator_get_current_key()
2024-10-15 12:23:45 +02:00
Arnaud Le Blanc
900afb6ff0 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix handling of invalid iterator in zend_weakmap_iterator_get_current_key()
2024-10-15 12:23:00 +02:00
Arnaud Le Blanc
1d94fb86b7 Fix handling of invalid iterator in zend_weakmap_iterator_get_current_key()
Fixes GH-16371
Closes GH-16436
2024-10-15 12:22:35 +02:00
Dmitry Stogov
023d66dc1f Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16393: Assertion failure in ext/opcache/jit/zend_jit.c:2897
2024-10-15 12:03:46 +03:00
Dmitry Stogov
f68dcc5a1c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16393: Assertion failure in ext/opcache/jit/zend_jit.c:2897
2024-10-15 12:03:36 +03:00
Dmitry Stogov
dd45d85531 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16393: Assertion failure in ext/opcache/jit/zend_jit.c:2897
2024-10-15 12:01:40 +03:00
Dmitry Stogov
bf786d0d28 Fix GH-16393: Assertion failure in ext/opcache/jit/zend_jit.c:2897 2024-10-15 12:00:59 +03:00
Calvin Buckley
edf351ce6d Mention where headers were already sent if session_start fails (#16378)
We had previously improved where sessions were already started, and
where headers were already sent when setting headers, but not where a
header has been sent if we try to set the header cookie.

Fixes GH-16372
2024-10-14 21:13:43 -03:00
Niels Dossche
275c7f21ab Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16429: Segmentation fault (access null pointer) in SoapClient
2024-10-14 22:00:49 +02:00
Niels Dossche
37db2edd26 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16429: Segmentation fault (access null pointer) in SoapClient
2024-10-14 22:00:45 +02:00
Niels Dossche
0b657fea2b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16429: Segmentation fault (access null pointer) in SoapClient
2024-10-14 22:00:29 +02:00
Niels Dossche
d613c0ed30 Fix GH-16429: Segmentation fault (access null pointer) in SoapClient
If get_iterator() fails, we should not destroy the object.
Also changes the check to a NULL check to be more defensive, and to
match the VM.

Closes GH-16441.
2024-10-14 21:59:51 +02:00
Niels Dossche
8f1543a76e Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16397: Segmentation fault when comparing FFI object (#16401)
2024-10-14 19:24:23 +02:00
Niels Dossche
7a7ab73d3b Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16397: Segmentation fault when comparing FFI object (#16401)
2024-10-14 19:24:17 +02:00
Niels Dossche
c924af0d6b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16397: Segmentation fault when comparing FFI object (#16401)
2024-10-14 19:24:01 +02:00
Niels Dossche
ec8a24f746 Fix GH-16397: Segmentation fault when comparing FFI object (#16401)
`compare` is a required handler [1], but this handler was set to NULL.
Throw an exception when trying to compare FFI objects.

[1] 35c8a010c6/Zend/zend_object_handlers.h (L231C1-L231C64)

Closes GH-16401.
2024-10-14 19:23:04 +02:00
Tim Düsterhus
3401d55726 zend_weakrefs: Add zend_weakrefs_hash_(clean|destroy)() (#16439)
These are equivalent to `zend_hash_clean()` and `zend_hash_destroy()`
respectively, but take care of correctly unregistering the weak references to
the keys.

This addition rounds off the weakmap functionality added in
471102edcd by taking one possible footgun away
from the user.
2024-10-14 18:57:08 +02:00
Ilija Tovilo
6292e5c878 Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Fix new closure dump syntax in test
2024-10-14 15:04:10 +02:00
Ilija Tovilo
253f4af90e [skip ci] Fix new closure dump syntax in test 2024-10-14 15:03:53 +02:00
Ilija Tovilo
fc210b44a6 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix deprecation warnings in tests
2024-10-14 14:28:12 +02:00
Ilija Tovilo
b1bd4e6a5c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix deprecation warnings in tests
2024-10-14 14:28:04 +02:00
Ilija Tovilo
817d21ecc4 Fix deprecation warnings in tests 2024-10-14 14:27:56 +02:00
Ilija Tovilo
b55b957adf Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix segfault on debug_backtrace() in _ZendTestFiber
2024-10-14 14:05:26 +02:00
Ilija Tovilo
e7dc0d2c40 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix segfault on debug_backtrace() in _ZendTestFiber
2024-10-14 14:05:21 +02:00
Ilija Tovilo
94bd6ca080 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix segfault on debug_backtrace() in _ZendTestFiber
2024-10-14 14:05:13 +02:00
Ilija Tovilo
5955ce8987 Fix segfault on debug_backtrace() in _ZendTestFiber
Fixes GH-16230
Closes GH-16299
2024-10-14 14:04:49 +02:00
Ilija Tovilo
8e3a7731cd Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix segfault in zend_test_execute_internal()
2024-10-14 14:03:34 +02:00
Ilija Tovilo
7d99355dad Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix segfault in zend_test_execute_internal()
2024-10-14 14:03:09 +02:00
Ilija Tovilo
0237361679 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix segfault in zend_test_execute_internal()
2024-10-14 14:03:01 +02:00
Ilija Tovilo
5c798415cd Fix segfault in zend_test_execute_internal()
zend_pass_function also has no name, so we might also be referring to an
internal function here. In this case, ZEND_NEW uses the zend_pass_function when
there is no constructor.

Fixes GH-16294
Closes GH-16301
2024-10-14 14:02:36 +02:00
Ilija Tovilo
41958082bd Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix exception in assert() callback with bail enabled
2024-10-14 14:01:26 +02:00
Ilija Tovilo
5f2f1a5702 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix exception in assert() callback with bail enabled
2024-10-14 14:01:16 +02:00
Ilija Tovilo
f512ff4afa Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix exception in assert() callback with bail enabled
2024-10-14 14:00:20 +02:00
Ilija Tovilo
b5c09b1a61 Fix exception in assert() callback with bail enabled
Fixes GH-16293
Closes GH-16304
2024-10-14 13:59:26 +02:00