1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 10:43:30 +02:00
Commit Graph

139387 Commits

Author SHA1 Message Date
Niels Dossche 75cca9f19e Fix memory leaks in array_any() / array_all()
The return value is overwritten, but if the key was not an interned
string we should destroy it.

Closes GH-17977.
2025-03-05 19:52:16 +01:00
Calvin Buckley b2e49c80bf Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Skip mysqli/tests/bug73462 on PPC CI (#17971)
2025-03-05 10:20:19 -04:00
Calvin Buckley a30a41af78 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Skip mysqli/tests/bug73462 on PPC CI (#17971)
2025-03-05 10:19:52 -04:00
Calvin Buckley 1afbaaa804 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Skip mysqli/tests/bug73462 on PPC CI (#17971)
2025-03-05 10:18:41 -04:00
Calvin Buckley dc6586dd9d Skip mysqli/tests/bug73462 on PPC CI (#17971)
* Skip this test on PPC CI

Seems to be unfortunately flaky with persistent connections.

* use spaces in phpt file
2025-03-05 10:17:39 -04:00
Ilija Tovilo 2076ab1248 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Upgrade i386 branch to Ubuntu 22.04
2025-03-03 23:24:21 +01:00
Ilija Tovilo 294888053a Upgrade i386 branch to Ubuntu 22.04 2025-03-03 22:15:23 +01:00
Dmitry Stogov f016caa312 Merge IR
IR commit: 1a02c4819f210a1f4548b83850ed7cd5c76c13aa
2025-03-03 23:48:08 +03:00
Calvin Buckley 7ae8f93e45 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Attempt at ppc64 CI (#17945)
2025-03-03 12:41:41 -04:00
Calvin Buckley 1615a21cd8 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Attempt at ppc64 CI (#17945)
2025-03-03 12:41:27 -04:00
Calvin Buckley aae9cd7b11 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Attempt at ppc64 CI (#17945)
2025-03-03 12:40:46 -04:00
Calvin Buckley 4694c3e997 Attempt at ppc64 CI (#17945)
This assumes gentoo (which has best ppc64be support of mainstream
distributions).

(Rebased onto the new workflow_call approach)
2025-03-03 10:04:02 -04:00
Niels Dossche 4c751ec04c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17938: UAF with zend_test opline observer and magic_quotes_gpc=1 (#17958)
2025-03-03 08:22:49 +01:00
Niels Dossche 504056888c Fix GH-17938: UAF with zend_test opline observer and magic_quotes_gpc=1 (#17958) 2025-03-03 08:20:48 +01:00
Niels Dossche ee4a9a4a7c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17736: Assertion failure zend_reference_destroy()
2025-03-02 22:37:07 +01:00
Niels Dossche ce8ab5f16a Fix GH-17736: Assertion failure zend_reference_destroy()
The cache slot for FETCH_OBJ_W in function `test` is primed with the
class for C. The next call uses a simplexml instance and reuses the same
cache slot. simplexml's get_property_ptr handler does not use the cache
slot, so the old values remain in the cache slot. When
`zend_handle_fetch_obj_flags` is called this is not guarded by a check
for the class entry. So we end up using the prop_info from the property
C::$a instead of the simplexml property.

This patch adds a reset to the cache slots in the property address fetch
code and also in the extensions with a non-standard reference handler.
This keeps the run time cache consistent and avoids the issue without
complicating the fast paths.

Closes GH-17739.
2025-03-02 22:33:32 +01:00
Jakub Zelenka 4936c32772 Merge branch 'PHP-8.3' into PHP-8.4 2025-02-28 14:51:52 +01:00
Jakub Zelenka 6bb56fe0cf Change openssl_x509_verify test to use cert generator (#17882)
This also prevents verifying cert with SHA1 signature
2025-02-28 14:51:12 +01:00
Niels Dossche 9e779dae7b Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix branch target in zend_jit_push_call_frame() (#17949)
2025-02-28 09:22:25 +01:00
Niels Dossche 422e90db3b Fix branch target in zend_jit_push_call_frame() (#17949)
Introduced by accident in 3b4a58da44.
Will request a cherry-pick.
2025-02-28 09:20:02 +01:00
Tim Düsterhus 2e999bad34 Fix ReflectionFunction::isDeprecated() for materialized __call() (#17914)
* Fix `ReflectionFunction::isDeprecated()` for materialized `__call()`

Fixes php/php-src#17913

* NEWS
2025-02-27 14:48:08 +01:00
Ilija Tovilo 8be263d2a1 Fix varying pgsql error message 2025-02-26 21:30:24 +01:00
Ilija Tovilo 376e90fbf2 Fix circumvented added hooks in JIT
The following code poses a problem in the JIT:

```php
class A {
    public $prop = 1;
}

class B extends A {
    public $prop = 1 {
        get => parent::$prop::get() * 2;
    }
}

function test(A $a) {
    var_dump($a->prop);
}

test(new B);
```

The JIT would assume A::$prop in test() could be accessed directly
through OBJ_PROP_NUM(). However, since child classes can add new hooks
to existing properties, this assumption no longer holds.

To avoid introducing more JIT checks, a hooked property that overrides a
unhooked property now results in a separate zval slot that is used
instead of the parent slot. This causes the JIT to pick the slow path
due to an IS_UNDEF value in the parent slot.

zend_class_entry.properties_info_table poses a problem in that
zend_get_property_info_for_slot() and friends will be called using the
child slot, which does not store its property info, since the parent
slot already does. In this case, zend_get_property_info_for_slot() now
provides a fallback that will iterate all property infos to find the
correct one.

This also uncovered a bug (see Zend/tests/property_hooks/dump.phpt)
where the default value of a parent property would accidentally be
inherited by the child property.

Fixes GH-17376
Closes GH-17870
2025-02-26 21:26:00 +01:00
Ilija Tovilo e0c69dde02 Fix accidentally inherited default value in overridden virtual properties
Discovered when working on GH-17376.
2025-02-26 21:16:58 +01:00
Ilija Tovilo 7a55116f12 Fix property hook backing value access in multi-level inheritance
Discovered by Niels when testing GH-17376.
2025-02-26 20:49:07 +01:00
David Carlier c8bead8393 Merge branch 'PHP-8.3' into PHP-8.4 2025-02-25 21:55:46 +00:00
David Carlier 8cbc0c57b7 Fix GH-17921 socket_read/socket_recv overflows on buffer size.
update the existing checks to be more straightforward instead of
counting on undefined behavior.

close GH-17923
2025-02-25 21:54:24 +00:00
DanielEScherzer a73fe50864 NEWS for 8.4.5: combine ext/GD sections [skip ci]
Closes GH-17930.
2025-02-25 22:34:25 +01:00
Eric Mann 00a772bf94 PHP-8.3 is now for PHP 8.3.19-dev 2025-02-25 09:20:39 -08:00
Saki Takamachi 1ec469d116 PHP-8.4 is now for PHP 8.4.6-dev 2025-02-26 00:02:20 +09:00
Daniel Scherzer 81f143e71f Reflection: indicate final and abstract properties in string output
Add "final" and "abstract" to the result of `_property_string()` when
outputting the string representation of a `ReflectionClass` or
`ReflectionProperty` instance

Closes GH-17827
2025-02-25 12:21:15 +01:00
Dmitry Stogov 819b1988a0 Update IR
IR commit: ca93e781eaf6b0949690d3df272ecf44528ff4a8
2025-02-25 02:23:05 +03:00
Jakub Zelenka ed00c1d74b Merge branch 'PHP-8.3' into PHP-8.4 2025-02-24 23:22:47 +01:00
Jakub Zelenka 930624899b Fix bug #72666: stat cache not cleared for plain paths
This adds more aggressive clearing of stat cache. It is added to the
filestat as well as plain wrapper operations which covers stream file
accessing as well as exec functions (using pipes). It should hopefully
fix the most visible issues with the stat cache.

Closes GH-17681
2025-02-24 23:21:45 +01:00
Niels Dossche fa4ae80928 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Backport GH-17869 to PHP 8.3 JIT
2025-02-24 21:46:00 +01:00
Niels Dossche 3b4a58da44 Backport GH-17869 to PHP 8.3 JIT
Closes GH-17918.
2025-02-24 21:45:03 +01:00
Niels Dossche 2542357b6d Fix GH-17866: zend_mm_heap corrupted error after upgrading from 8.4.3 to 8.4.4
This regressed in GH-17592.
The function is with its attributes HashTable* is copied in
zend_get_closure_invoke_method() but its refcount is not increased.
This caused a crash in the Symfony demo page.

Closes GH-17880.
2025-02-24 21:39:55 +01:00
Daniel Scherzer c0857e0d8a Fix GH-17916: Final abstract properties should error
Closes GH-17917.
2025-02-24 20:17:41 +01:00
Niels Dossche 5ede5415e1 Fix GH-17868: Cannot allocate memory with tracing JIT on 8.4.4
The generated code tries to initialize the run time cache for even
internal closures, but it should only initialize the run time cache for
user closures. We fix this by adding a check for the function type.
If `func` is known, then we can check the type at code generation time.

Closes GH-17869.
2025-02-24 19:36:13 +01:00
Ilija Tovilo ca75ebf3a1 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Use laravel default branch in community build
2025-02-24 15:58:40 +01:00
Ilija Tovilo a93ad360cb Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Use laravel default branch in community build
2025-02-24 15:58:31 +01:00
Ilija Tovilo 09d7f69793 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Use laravel default branch in community build
2025-02-24 15:58:23 +01:00
Ilija Tovilo e71b8cae7e [skip ci] Use laravel default branch in community build
See: https://github.com/laravel/framework/issues/54754#issuecomment-2678092563

According to this comment, the default branch more actively receives
changes throuought the year than master. Hence, it makes more sense to
test the default branch.
2025-02-24 15:58:04 +01:00
Bob Weinand 53fa98ecd3 Fix GH-17715: Handle preloaded internal function runtime cache (#17835)
This solely affects the builtin enum functions currently.

Given that these are stored in SHM, we cannot simply hardwire a pointer into the internal function runtime cache on NTS too, but have to use a MAP_PTR (like on ZTS).
Now, by design, the runtime cache of internal functions no longer is reset between requests, hence we need to store them explicitly as static runtime cache.

On NTS builds we cannot trivially move the pointers into CG(internal_run_time_cache) as they're directly stored on the individual functions (on ZTS we could simply iterate the static map_ptrs).
Hence, we have the choice between having opcache managing the internal run_time_cache for its preloaded functions itself or realloc CG(internal_run_time_cache) and iterate through all functions to assign the new address. We choose the latter for simplicity and initial speed.
2025-02-24 14:35:47 +01:00
David Carlier fc73da57f4 Merge branch 'PHP-8.3' into PHP-8.4 2025-02-24 07:14:56 +00:00
Michael Orlitzky 174a7fe6f9 Fix GH-17891 gh17373.phpt test issue without freetype support
skip if imagefttext() is not available

This test calls imagefttext(), which may not be available if libgd
was built without freetype support.

Closes GH-17910
2025-02-24 07:13:11 +00:00
David Carlier 34d0e4f31f Merge branch 'PHP-8.3' into PHP-8.4 2025-02-23 16:02:35 +00:00
Michael Orlitzky 065b4ec125 ext/gd/tests: backport optional PNG support
- Three of our gd tests could be skipped with a message about requiring
bundled GD, but those tests don't actually require bundled GD. We
update the messages to mention the specific functions that are
required.

- add SKIPIF stanzas for missing PNG support

The bundled libgd always has PNG support, but an external one may not.

- imagerotate() is always available

Following 59ec80c5, the imagerotate() function is always available. We
may therefore remove its function_exists() checks without harm.

close GH-17894
2025-02-23 16:01:30 +00:00
Niels Dossche 635fe263ac Fix memory leaks in pdo_sqlite callback registration
* We need to clean the trampoline if the construction check fails
* Checking for an exception and then returning causes a leak on
  `collation`. Returning early is pointless anyway.

Closes GH-17904.
2025-02-23 16:35:55 +01:00
Niels Dossche 76035090b6 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix cycle leak in sqlite3 setAuthorizer()
2025-02-23 16:35:25 +01:00