1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 07:58:20 +02:00
Commit Graph

14776 Commits

Author SHA1 Message Date
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
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
Gina Peter Banyard 064ea9c505 Inlines the behaviour of php_mkdir_ex() into plain wrapper mkdir handler (#15520)
This effectively inlines the behaviour of php_mkdir_ex() which is a deprecated API from at least 17 years ago, and also fixes some of the return values.

This also removes a dependency on ext/standard
2024-09-23 00:40:02 +01: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
Michael Voříšek d313ad6098 Deprecate E_STRICT constant and remove error level
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant

Closes GH-13053
2024-09-18 14:33:14 +02:00
Gina Peter Banyard ae4ef32d68 ext/standard/browscap.c: Minor refactorings (#15885)
- Use more appropriate types
- Add const modifiers
- Reduce scope of some variable
- Prevent shadowing of variable
2024-09-17 16:48:21 +01:00
Gina Peter Bnayard 3f1a4441bd ext/standard: Make char* of php_stristr() const 2024-09-14 14:00:46 +01:00
Gina Peter Banyard f756b96e06 Make CSV deprecation less annoying to deal with (#15569) 2024-09-13 15:07:26 +01:00
Gina Peter Bnayard ab99161444 ext/standard/versioning.c: Slightly refactor compare_special_version_forms() 2024-09-12 18:13:01 +01:00
Gina Peter Bnayard 8109d21065 ext/standard/url.c: Stop exposing php_replace_controlchars_ex()
This is not used from a quick search on SourceGraph and this allows us to refactor it
2024-09-12 18:13:01 +01:00
Gina Peter Bnayard d45eb46c97 ext/standard/type.c: Remove unused include 2024-09-12 18:13:01 +01:00
Gina Peter Bnayard 85e6688791 ext/standard/string.c: Remove to(upper|lower) PHP API in favour of Zend APIs 2024-09-12 18:13:01 +01:00
Gina Peter Bnayard 1b87772f40 ext/standard/string.c: Refactor php_spn_common_handler()
Main objective is to remove the PHP_STR_STR(C)SPN symbols which are only used with this static function
2024-09-12 18:13:01 +01:00
Gina Peter Bnayard 312f789e22 ext/standard/quot_print.c: Mark readonly string as const 2024-09-12 18:13:01 +01:00
Gina Peter Bnayard 5c191a45d9 ext/standard/quot_print.c: Minor refactoring to php_hex2int()
We already check, and assume, that the value is hexadecimal
2024-09-12 18:13:01 +01:00
David Carlier ea0937b550 Merge branch 'PHP-8.3' 2024-09-11 21:16:26 +01:00
David Carlier b975b6c9ab Merge branch 'PHP-8.2' into PHP-8.3 2024-09-11 21:15:42 +01:00
David Carlier 791a6ef19c Fix GH-15613: unpack on format hex strings repeater value.
close GH-15615
2024-09-11 21:14:27 +01:00
DanielEScherzer db545767e5 Rename ZEND_STR_DEPRECATED to ZEND_STR_DEPRECATED_CAPITALIZED (#15831)
To match other capitalized strings like `ZEND_STR_UNKNOWN_CAPITALIZED` and
`ZEND_STR_ARRAY_CAPITALIZED`. Since this known string was only added in PHP
8.4, no backwards compatibility alias is needed.
2024-09-10 22:45:23 +01:00
Niels Dossche 1cf98db425 Deduplicate Proxy-Authorization code from php_stream_url_wrap_http_ex() (#15818)
Extracts this code to a separate function to reduce code duplication.
2024-09-10 21:17:14 +02:00
Ilija Tovilo 6ed730eb59 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix MSAN getservbyport() false positive
  Fix uninitialized CG(zend_lineno)
  Fix uninitialized EG(user_error_handler_error_reporting)
2024-09-09 19:35:09 +02:00
Ilija Tovilo a5bd4ccb8c Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix MSAN getservbyport() false positive
  Fix uninitialized CG(zend_lineno)
  Fix uninitialized EG(user_error_handler_error_reporting)
2024-09-09 19:35:00 +02:00
Ilija Tovilo 0faa1d2017 Fix MSAN getservbyport() false positive
Closes GH-15814
2024-09-09 19:34:43 +02:00