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

138647 Commits

Author SHA1 Message Date
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
Christoph M. Becker
d531fbd8b0 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16427: Unchecked libavif return values
2024-10-14 13:55:22 +02:00
Christoph M. Becker
055b15f08c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16427: Unchecked libavif return values
2024-10-14 13:54:52 +02:00
Christoph M. Becker
05176adc4e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16427: Unchecked libavif return values
2024-10-14 13:53:42 +02:00
Christoph M. Becker
b817a4f718 Fix GH-16427: Unchecked libavif return values
Prior to libavif 1.1.0, `avifAlloc()` was infallible (it called
`abort()` on OOM conditions); thus, several API functions which used
`avifAlloc()` did not report failure.  That changed as of libavif
1.0.0[1], so checking and handling failure conditions can now be done.
However, due to `avifAlloc()` being fallible as of libavif 1.1.0, this
error checking and handling is mandatory to avoid more serious issues.

[1] <eb02b2ec52/CHANGELOG.md (L273-L281)>

Closes GH-16434.
2024-10-14 13:52:45 +02:00
Ilija Tovilo
16d25da76b Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix op2 caching for static properties
  Split expression
2024-10-14 13:46:04 +02:00
Ilija Tovilo
67318e91bc Fix op2 caching for static properties
op2.num may contain other flags, like ZEND_FETCH_CLASS_EXCEPTION. These
currently circumvent caching. Once the property is cached, these flags have no
influence on the result, so it doesn't seem like this was done on purpose.

Closes GH-16380
2024-10-14 13:45:06 +02:00
Ilija Tovilo
60562175ed Split expression 2024-10-14 13:43:48 +02:00
David Carlier
323c9f4981 [skip ci] UPGRADING/NEWS changes 2024-10-14 12:42:01 +01:00
David Carlier
6d1881b42d ext/zlib: gzfile/gzopen/readgzfile converting use_include_path argument to actual boolean.
close GH 16424
2024-10-14 12:40:57 +01:00
Ilija Tovilo
0f172715b0 Merge branch 'PHP-8.4'
* PHP-8.4:
  Skip shebang in cli-server router script
2024-10-14 13:35:48 +02:00
Ilija Tovilo
3074cbf5b6 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Skip shebang in cli-server router script
2024-10-14 13:35:41 +02:00
Ilija Tovilo
77f770871b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Skip shebang in cli-server router script
2024-10-14 13:34:21 +02:00
Ilija Tovilo
06efe44c2e Skip shebang in cli-server router script
Fixes GH-16373
Closes GH-16403
2024-10-14 13:33:16 +02:00
Ilija Tovilo
39533af024 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix array to string conversion warning emitted in optimizer
2024-10-14 13:25:39 +02:00
Ilija Tovilo
3546733065 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix array to string conversion warning emitted in optimizer
2024-10-14 13:25:31 +02:00
Ilija Tovilo
c5745f40a5 Fix array to string conversion warning emitted in optimizer
Fixes GH-16408
Closes GH-16380
2024-10-14 13:24:05 +02:00
DanielEScherzer
275f63e7fd Zend/tests: organize some tests with subdirectories (2) (#16423)
Move more low-hanging fruit, creating new directories for the tests for:

* comparisons
* dynamic calls
* error messages
* `error_reporting()`
* exceptions
* `foreach()`
* garbage collection
* group `use` statements
* heredoc and nowdoc
* `goto` jumps
* late static binding
* magic methods
* namespaces
* numeric literal separators
* objects
* `settype()`
* cleaning of temporary values
* `unset()`

Additionally, move some tests into the existing subdirectory for `list()`
tests.

Drive-by fixes of some test numbers in the names of the `goto` tests.

Work towards GH-15631
2024-10-14 12:14:42 +01:00
Christoph M. Becker
fe76b396f5 Move ARG_(WITH|ENABLE) to the toplevel (GH-16391)
`buildconf` (and `phpize`) have special treatment for these "macros".
When configure.js is built, all config.w32 are grepped, these "macros"
are appended to configure.js, and all config.w32 contents are appended
with the "macros" commented out.  That means that for `configure` they
are in the toplevel anyway, so having them inside of `if` statements in
config.w32 is confusing.

Note that this matches autoconf behavior.
2024-10-14 10:42:19 +02:00
Niels Dossche
41c55d18f5 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16409: Segfault in exif_thumbnail when not dealing with a real file
2024-10-13 21:13:12 +02:00
Niels Dossche
63c9d12a1e Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16409: Segfault in exif_thumbnail when not dealing with a real file
2024-10-13 21:13:06 +02:00
Niels Dossche
34e635f366 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16409: Segfault in exif_thumbnail when not dealing with a real file
2024-10-13 21:12:46 +02:00
Niels Dossche
3843f0ecfe Fix GH-16409: Segfault in exif_thumbnail when not dealing with a real file
Closes GH-16416.
2024-10-13 21:12:17 +02:00
Gina Peter Banyard
810a121201 Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Some more organisational fixes to UPGRADING
2024-10-13 18:49:58 +01:00
Gina Peter Banyard
da4eab6c5c [skip ci] Some more organisational fixes to UPGRADING
Closes GH-16415
2024-10-13 18:49:10 +01:00
David Carlier
79c71c9f0b Merge branch 'PHP-8.4' 2024-10-13 14:27:24 +01:00
David Carlier
61d34b3ebc Merge branch 'PHP-8.3' into PHP-8.4 2024-10-13 14:26:59 +01:00
David Carlier
47c81462b8 Merge branch 'PHP-8.2' into PHP-8.3 2024-10-13 14:26:47 +01:00
David Carlier
d70b7811b0 ext/gmp: gmp_pow fix FPE with large values.
even without sanitizers, it is reproducible but with the following

```
<?php
$g = gmp_init(256);
var_dump(gmp_pow($g, PHP_INT_MAX));
```

we get this

```
AddressSanitizer:DEADLYSIGNAL
=================================================================
==286922==ERROR: AddressSanitizer: FPE on unknown address 0x03e8000460ca (pc 0x7faf6c69de5c bp 0x400000000000004 sp 0x7ffe9843c740 T0)
    #0 0x7faf6c69de5c in __pthread_kill_implementation nptl/pthread_kill.c:44
    #1 0x7faf6c649c81 in __GI_raise ../sysdeps/posix/raise.c:26
    #2 0x7faf6db9386c in __gmp_exception (/lib/x86_64-linux-gnu/libgmp.so.10+0xd86c) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #3 0x7faf6db938d3 in __gmp_overflow_in_mpz (/lib/x86_64-linux-gnu/libgmp.so.10+0xd8d3) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #4 0x7faf6dbac95c in __gmpz_realloc (/lib/x86_64-linux-gnu/libgmp.so.10+0x2695c) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #5 0x7faf6dba9038 in __gmpz_n_pow_ui (/lib/x86_64-linux-gnu/libgmp.so.10+0x23038) (BuildId: 1af68a49fe041a5bb48a2915c3d47541f713bb38)
    #6 0x5565ae1ccd9f in zif_gmp_pow /home/dcarlier/Contribs/php-src/ext/gmp/gmp.c:1286
    #7 0x5565aee96ea9 in ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:1312
    #8 0x5565af144320 in execute_ex /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:56075
    #9 0x5565af160f07 in zend_execute /home/dcarlier/Contribs/php-src/Zend/zend_vm_execute.h:60439
    #10 0x5565aed6fafe in zend_execute_scripts /home/dcarlier/Contribs/php-src/Zend/zend.c:1842
    #11 0x5565aeae70a8 in php_execute_script /home/dcarlier/Contribs/php-src/main/main.c:2578
    #12 0x5565af532f4e in do_cli /home/dcarlier/Contribs/php-src/sapi/cli/php_cli.c:964
    #13 0x5565af535877 in main /home/dcarlier/Contribs/php-src/sapi/cli/php_cli.c:1334
    #14 0x7faf6c633d67 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #15 0x7faf6c633e24 in __libc_start_main_impl ../csu/libc-start.c:360
    #16 0x5565adc04040 in _start (/home/dcarlier/Contribs/php-src/sapi/cli/php+0x2604040) (BuildId: 949049955bdf8b7197390b1978a1dfc3ef6fdf38)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE nptl/pthread_kill.c:44 in __pthread_kill_implementation
==286922==ABORTING
```
2024-10-13 14:26:29 +01:00
DanielEScherzer
8475d5fea1 Zend/tests: organize some tests with subdirectories (#15638)
Move some low-hanging fruit, creating new directories for the tests for

* access modifiers
* `class_alias()`
* constant expressions
* constructor property promotion
* `__debugInfo()`
* dereferencing
* first class callable syntax

Additionally, move some tests into the existing subdirectory for
closure-related tests

Work towards GH-15631
2024-10-13 14:21:07 +01:00
David Carlier
ecccb36a41 Merge branch 'PHP-8.4' 2024-10-13 14:20:04 +01:00
David Carlier
4d008e300b Merge branch 'PHP-8.3' into PHP-8.4 2024-10-13 14:19:45 +01:00
David Carlier
f31232e218 Merge branch 'PHP-8.2' into PHP-8.3 2024-10-13 14:19:33 +01:00
David Carlier
84a8fea251 Fix GH-16290: session cookie_lifetime ini value overflow.
close GH-16295
2024-10-13 14:19:18 +01:00
DanielEScherzer
150599e5ac win32/dllmain.c: drop some unused code (#16353)
The code block is guarded by `#if 0`, and even if it wasn't it is a switch that
only contains breaks, i.e. it wouldn't actually do anything if enabled.
2024-10-13 11:24:22 +01:00
Christoph M. Becker
b2ff871e38 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16326: Memory management is broken for bad dictionaries
2024-10-13 02:31:16 +02:00
Christoph M. Becker
a7918a7ac3 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16326: Memory management is broken for bad dictionaries
2024-10-13 02:30:38 +02:00
Christoph M. Becker
631c04e690 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16326: Memory management is broken for bad dictionaries
2024-10-13 02:29:22 +02:00
Christoph M. Becker
d94be24f30 Fix GH-16326: Memory management is broken for bad dictionaries
We must not `efree()` `zend_string`s, since they may have a refcount
greater than one, and may even be interned.

We also must not confuse `zend_string *` with `zend_string **`.

And we should play it safe by using `safe_emalloc()` to avoid
theoretical integer overflows.

We also simplify a bit, according to suggestions of @TimWolla.

Closes GH-16335.
2024-10-13 02:28:07 +02:00
Ilija Tovilo
50b6713a25 Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Mark some more macOS tests as flaky
2024-10-13 02:07:27 +02:00
Ilija Tovilo
b7e39970d3 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Mark some more macOS tests as flaky
2024-10-13 02:07:19 +02:00
Ilija Tovilo
5c8f42f05c Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Mark some more macOS tests as flaky
2024-10-13 02:07:11 +02:00
Ilija Tovilo
b6ca871396 [skip ci] Mark some more macOS tests as flaky 2024-10-13 02:06:57 +02:00
Daniel Scherzer
6c9db6085a ext/standard/exec.c: combine conditions, update docs
While `php_escape_shell_cmd()` did indeed `emalloc` a string that needed to be
freed by the caller in the original implementation that was put in GitHub
(see commit 257de2bade) a few months ago the
return type was changed to use `zend_string`, see #14353.

Closes GH-16313
2024-10-13 01:33:03 +02:00
Niels Dossche
e150b0b3a1 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16318: Recursive array segfaults soap encoding
2024-10-12 23:30:50 +02:00
Niels Dossche
f108c1675e Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16318: Recursive array segfaults soap encoding
2024-10-12 23:30:44 +02:00
Niels Dossche
6ff4a2d7a8 Fix GH-16318: Recursive array segfaults soap encoding
This adds recursion protection to the array encoders.

Closes GH-16347.
2024-10-12 23:20:15 +02:00