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

6168 Commits

Author SHA1 Message Date
Niels Dossche
ab7c3b1e7b Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16957: Assertion failure in array_shift with self-referencing array
2024-11-29 19:21:49 +01:00
Niels Dossche
f1fc4e8ff7 Fix GH-16957: Assertion failure in array_shift with self-referencing array
We have an RC1 violation because we're immediately dereferencing and
copying the resulting array in the test case. Instead, transfer the
lifetime using RETVAL_COPY_VALUE and unwrap only after the internal
iterator is reset.

Closes GH-16970.
2024-11-29 19:21:11 +01:00
Niels Dossche
3a80936391 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16905: Internal iterator functions can't handle UNDEF properties
2024-11-28 19:22:55 +01:00
Niels Dossche
6a195bd9e7 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16905: Internal iterator functions can't handle UNDEF properties
2024-11-28 19:22:36 +01:00
Niels Dossche
e1b4534790 Fix GH-16905: Internal iterator functions can't handle UNDEF properties
Closes GH-16907.
2024-11-28 19:22:10 +01:00
Christoph M. Becker
8a5fd6c027 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Use another for bug51056.phpt
2024-11-25 22:06:59 +01:00
Christoph M. Becker
0b5de3014a Use another for bug51056.phpt
This port is already used by san_ipv6_peer_matching.phpt, wo we choose
another port which is not explicitly used in our test suite.  The
proper solution would be to use ephemeral ports[1], but our OpenSSL
`ServerClientTestCase` does not support this yet.

[1] <6ab4e330ac>

Closes GH-16871.
2024-11-25 22:06:04 +01:00
Christoph M. Becker
053af52835 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix potential conflict of copy_variation5-win32.phpt
2024-11-25 13:50:16 +01:00
Christoph M. Becker
4ceae71954 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix potential conflict of copy_variation5-win32.phpt
2024-11-25 13:49:20 +01:00
Christoph M. Becker
12ef3da381 Fix potential conflict of copy_variation5-win32.phpt
copy_variation1.phpt also creates and deletes a file copy.tmp in the
same folder, so conflicts may occur[1].  We apply a quick fix.

[1] <https://github.com/php/php-src/actions/runs/11902293714/job/33167012826>

Closes GH-16854.
2024-11-25 13:48:50 +01:00
Christoph M. Becker
19e685ecc4 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Skip file_put_contents_variation7.phpt on Windows
2024-11-20 15:51:48 +01:00
Christoph M. Becker
38ec780015 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Skip file_put_contents_variation7.phpt on Windows
2024-11-20 15:50:54 +01:00
Christoph M. Becker
3656a84c39 Skip file_put_contents_variation7.phpt on Windows
While the test obviously succeeds on Windows, it may occasionally
conflict with file_put_contents_variation7-win32.phpt[1], so we skip it
like we do for many other of these tests which have win32 pendants.

[1] <https://github.com/php/php-src/actions/runs/11527743659/job/32093951818>

Closes GH-16722.
2024-11-20 15:50:24 +01:00
Jakub Zelenka
7c96af42b7 Merge branch 'PHP-8.3' into PHP-8.4 2024-11-20 11:14:04 +01:00
Jakub Zelenka
ffff27f734 Merge branch 'PHP-8.2' into PHP-8.3 2024-11-20 11:12:19 +01:00
Niels Dossche
f3ade203d7 Fix GHSA-r977-prxv-hc43
Move the bound check upwards. Since this doesn't generate output we can
check the bound first.
2024-11-20 11:07:04 +01:00
Jakub Zelenka
d7fe40868e Fix GHSA-c5f2-jwm7-mmq2: stream HTTP fulluri CRLF injection 2024-11-20 11:06:02 +01:00
Christoph M. Becker
5f5d2c04c3 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix rename_variation12*.phpt parallel test conflicts
2024-11-08 00:25:24 +01:00
Christoph M. Becker
03eeec16f0 Fix rename_variation12*.phpt parallel test conflicts
For rename_variation12.phpt this is actually not necessary, since there
is no rename_variation11.phpt, but we still fix it to be in sync with
rename_variation12-win32.phpt which actually is prone to parallel
conflicts.

(cherry picked from commit d4263ddc40)
2024-11-08 00:24:49 +01:00
Arnaud Le Blanc
4c212b305f Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix tests: Prevent stack overflow during dtor
2024-10-24 15:58:12 +02:00
Arnaud Le Blanc
f3e87e2a6d Fix tests: Prevent stack overflow during dtor
On s390x the stack is smaller and/or the object dtor code uses more stack,
which causes the destruction of deeply nested objects to crash in these
tests. Here I ensure that objects are released one by one at the end of the
tests to avoid recursive dtor.

Closes GH-16561
Fixes GH-16528
2024-10-24 15:56:25 +02:00
Niels Dossche
612a6ad0af Use standard error message for stack limit in serialize()
With GH-16204 merged, we can use the standard error message for the
recently-merged GH-16159.

Closes GH-16225.
2024-10-04 20:09:45 +02:00
Niels Dossche
577eb68212 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-15169: stack overflow when var serialization in ext/standard/var
2024-10-02 21:32:20 +02:00
Niels Dossche
bd724bdf42 Fix GH-15169: stack overflow when var serialization in ext/standard/var
Adding a stack check here as I consider serialization to be a more
sensitive place where erroring out with an exception seems appropriate.

Closes GH-16159.
2024-10-02 21:30:59 +02:00
Arnaud Le Blanc
3952a8f9f1 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [ci skip] NEWS for GH-16061
  Fix array_merge_recursive(): convert_to_array() may need separation (#16061)
2024-10-02 12:44:00 +02:00
Arnaud Le Blanc
220c8828cc Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS for GH-16061
  Fix array_merge_recursive(): convert_to_array() may need separation (#16061)
2024-10-02 12:43:48 +02:00
Arnaud Le Blanc
545bef8ae6 Fix array_merge_recursive(): convert_to_array() may need separation (#16061) 2024-10-02 12:37:04 +02:00
David Carlier
4ad12bdd2d Merge branch 'PHP-8.3' into PHP-8.4 2024-09-30 18:11:25 +01:00
David Carlier
d828308095 Merge branch 'PHP-8.2' into PHP-8.3 2024-09-30 18:11:14 +01:00
David Carlier
332b067c5e Fix GH-15937: stream timeout option overflow.
close GH-15942
2024-09-30 18:10:33 +01:00
Christoph M. Becker
ebee8df27e Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix potential parallel test conflicts
2024-09-29 02:13:06 +02:00
Christoph M. Becker
a17634c029 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix potential parallel test conflicts
2024-09-29 02:11:48 +02:00
Christoph M. Becker
f5649556ea Fix potential parallel test conflicts
Both tests call `create_files()` with the same `$name_prefix` what
might clash.

Co-authored-by: Gina Peter Banyard <girgias@php.net>

Closes GH-16103.
2024-09-29 02:05:14 +02:00
Ilija Tovilo
28d88c72bc Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Reduce regex backtracking in phpinfo.phpt
2024-09-27 17:10:58 +02:00
Ilija Tovilo
0226e5d01d Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Reduce regex backtracking in phpinfo.phpt
2024-09-27 17:10:47 +02:00
Ilija Tovilo
c4c45da4b9 Reduce regex backtracking in phpinfo.phpt
On NixOS, the output of phpinfo() can get very large, causing us to run into the
backtracking limit. Lazy matching for .*/.+ can help reduce backtracking.
2024-09-27 15:02:21 +02:00
Christoph M. Becker
f44250c418 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15980: Signed integer overflow in main/streams/streams.c
2024-09-24 12:35:06 +02:00
Christoph M. Becker
acee803e6a Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15980: Signed integer overflow in main/streams/streams.c
2024-09-24 12:33:17 +02:00
Christoph M. Becker
81916758ec Fix GH-15980: Signed integer overflow in main/streams/streams.c
We need to avoid signed integer overflows which are undefined behavior.
We catch that, and set `offset` to `ZEND_LONG_MAX` (which is also the
largest value of `zend_off_t` on all platforms).  Of course, that seek
may fail, but even if it succeeds, the stream is no longer readable,
but that matches the current behavior for offsets near `ZEND_LONG_MAX`.

Closes GH-15989.
2024-09-24 12:32:00 +02:00
Christoph M. Becker
8a5ada4e10 Merge branch 'PHP-8.3'
* PHP-8.3:
  Revert "Fix GH-15980: Signed integer overflow in main/streams/streams.c"
2024-09-23 01:33:57 +02:00
Christoph M. Becker
a9fcf498e3 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Revert "Fix GH-15980: Signed integer overflow in main/streams/streams.c"
2024-09-23 01:32:45 +02:00
Christoph M. Becker
ee95ee7216 Revert "Fix GH-15980: Signed integer overflow in main/streams/streams.c"
This reverts commit 6a04c79e41, since the
new test case apparently fails on 64bit Linux, so this needs closer
investigation.
2024-09-23 01:31:05 +02:00
Christoph M. Becker
10008fb6e8 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15980: Signed integer overflow in main/streams/streams.c
2024-09-23 00:30:29 +02:00
Christoph M. Becker
c701508e6b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15980: Signed integer overflow in main/streams/streams.c
2024-09-23 00:29:15 +02:00
Christoph M. Becker
6a04c79e41 Fix GH-15980: Signed integer overflow in main/streams/streams.c
We need to avoid signed integer overflows which are undefined behavior.
We catch that, and set `offset` to `ZEND_LONG_MAX` (which is also the
largest value of `zend_off_t` on all platforms).  Of course, after such
a seek a stream is no longer readable, but that matches the current
behavior for offsets near `ZEND_LONG_MAX`.

Closes GH-15989.
2024-09-23 00:28:09 +02:00
Niels Dossche
5bfd45cd44 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15908 and GH-15026: leak / assertion failure in streams.c
2024-09-22 16:09:21 +02:00
Niels Dossche
94c2ae616b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15908 and GH-15026: leak / assertion failure in streams.c
2024-09-22 16:08:51 +02:00
Niels Dossche
018c0b3d14 Fix GH-15908 and GH-15026: leak / assertion failure in streams.c
This was first reported as a leak in GH-15026, but was mistakingly
believed to be a false positive. Then an assertion was added and it got
triggered in GH-15908. This fixes the leak. Upon merging into master the
assertion should be removed as well.

Closes GH-15924.
2024-09-22 16:07:12 +02:00
Niels Dossche
27b3131422 Fix GH-15982: Assertion failure with array_find when references are involved
Closes GH-15983.
2024-09-22 14:34:55 +02:00
Ilija Tovilo
1b9568d354 Implement backed enum coercion in http_build_query()
Fixes GH-15650
Closes GH-15704
2024-09-19 00:27:09 +02:00