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

134816 Commits

Author SHA1 Message Date
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
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
2bcf3f9e23 [ci skip] NEWS for GH-16061 2024-10-02 12:43:30 +02:00
Arnaud Le Blanc
0516d95a1c [ci skip] NEWS for GH-16061 2024-10-02 12:38:59 +02:00
Arnaud Le Blanc
644ebb2aa0 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS for GH-16061
2024-10-02 12:38:33 +02:00
Arnaud Le Blanc
56bcc7f3d0 [ci skip] NEWS for GH-16061 2024-10-02 12:38:24 +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
Arnaud Le Blanc
26fd8d2ca6 [ci skip] NEWS for GH-16025 2024-10-02 12:32:53 +02:00
Arnaud Le Blanc
7e6616cafb Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS for GH-16025
  Fix assertion failure in generator dtor (#16025)
2024-10-02 12:31:21 +02:00
Arnaud Le Blanc
36945ecb71 [ci skip] NEWS for GH-16025 2024-10-02 12:30:27 +02:00
Arnaud Le Blanc
6e55f4df23 Fix assertion failure in generator dtor (#16025) 2024-10-02 12:29:19 +02:00
Niels Dossche
cd67c090a9 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16151: Assertion failure in ext/dom/parentnode/tree.c
2024-10-01 21:47:26 +02:00
Niels Dossche
066d18f2e8 Fix GH-16151: Assertion failure in ext/dom/parentnode/tree.c
Unfortunately, old DOM allows attributes to be used as parent nodes.
Only text nodes and entities are allowed as children for these types of
nodes, because that's the constraint DOM and libxml give us.

Closes GH-16156.
2024-10-01 21:46:12 +02:00
Niels Dossche
63e1ebe78d Fix GH-16149: Null pointer dereference in DOMElement->getAttributeNames()
A namespace without a prefix is by definition always the "xmlns"
namespace.

Closes GH-16155.
2024-10-01 21:02:23 +02:00
Niels Dossche
4a1694090b [ci skip] Skip test under ASAN
We backport 1d0fb36681 to PHP-8.3.
2024-10-01 13:58:40 +02:00
Gina Peter Banyard
10b5d4beb5 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  NEWS entries for LDAP bug fixes
  ext/ldap: Fix GH-16136 (Memory leak in php_ldap_do_modify())
  ext/ldap: Fix GH-16132 (Freeing pointer not allocated by ZMM)
2024-09-30 22:24:08 +01:00
Gina Peter Banyard
f8b925b617 NEWS entries for LDAP bug fixes 2024-09-30 22:23:27 +01:00
Gina Peter Banyard
21260318c6 ext/ldap: Fix GH-16136 (Memory leak in php_ldap_do_modify()) 2024-09-30 22:23:01 +01:00
Gina Peter Banyard
c910e78c39 ext/ldap: Fix GH-16132 (Freeing pointer not allocated by ZMM)
Closes GH-16134
2024-09-30 22:23:01 +01:00
Niels Dossche
a551b99b2c Fix GH-15168: stack overflow in json_encode()
The JSON encoder is recursive, and it's far from easy to make it
iterative. Add a cheap stack limit check to prevent a segfault.
This uses the PHP_JSON_ERROR_DEPTH error code that already talks about
the stack depth. Previously this was only used for the $depth argument.

Closes GH-16059.
2024-09-30 20:42:01 +02: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
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
Gina Peter Banyard
0f2fe67b2a Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/ldap: Fix GH-16101 (Segfaults in php_ldap_do_search() when LDAPs is not a list)
2024-09-28 19:54:06 +01:00
Gina Peter Banyard
19bba83715 ext/ldap: Fix GH-16101 (Segfaults in php_ldap_do_search() when LDAPs is not a list)
Closes GH-16102
2024-09-28 19:52:47 +01:00
Jakub Zelenka
37a73a83c3 Merge branch 'PHP-8.2' into PHP-8.3 2024-09-28 16:24:01 +01:00
Jakub Zelenka
dce0d97640 Fix stub for openssl_csr_new 2024-09-28 16:22:08 +01:00
Christoph M. Becker
6556e59865 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix failing soap tests on Windows
2024-09-27 19:58:30 +02:00
Christoph M. Becker
9f63657765 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix failing soap tests on Windows
2024-09-27 19:57:47 +02:00
Christoph M. Becker
5f3e6e346c Fix failing soap tests on Windows
These failures are caused by the fix for GHSA-p99j-rfp4-xqvq.  Since
the two bug*.phpt tests don't need the "wsdl" query string, and don't
even need php-cgi, we just remove the `--GET--` section.  The two
server*.phpt tests are harder to fix, since during evaluation of the
`--SKIPIF--` section, the soap extension can be loaded, but it may not
during evaluation of the `--FILE--` section.  So for now, we skip these
tests on Windows altogether.

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Closes GH-16084.
2024-09-27 19:56:19 +02:00
Ilija Tovilo
8c556b211d Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix printing backtrace of fake generator frame
2024-09-27 17:35:55 +02:00
Ilija Tovilo
706bcdbc1a Fix printing backtrace of fake generator frame
Fixes GH-15851
Closes GH-15952
2024-09-27 17:34:51 +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
Ilija Tovilo
5cff4a9b69 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix failed assertion when promoting Serialize deprecation to exception
2024-09-26 22:03:01 +02:00
Ilija Tovilo
15a0c3a9d4 Fix failed assertion when promoting Serialize deprecation to exception
Fixes GH-15907
Closes GH-15951
2024-09-26 22:01:59 +02:00
Ben Ramsey
6d99ccc268 Merge branch 'PHP-8.2' into PHP-8.3 2024-09-26 14:13:00 -05:00
Ben Ramsey
c259c9f3f6 Merge branch 'PHP-8.1' into PHP-8.2 2024-09-26 13:13:46 -05:00
Ben Ramsey
fcbcf2f281 PHP-8.1 is now for PHP 8.1.31-dev 2024-09-26 12:52:41 -05:00
Christoph M. Becker
bf8c01db7f Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15905: Assertion failure for TRACK_VARS_SERVER
2024-09-26 15:34:34 +02:00
Christoph M. Becker
87d59d7fdd Fix GH-15905: Assertion failure for TRACK_VARS_SERVER
When the superglobals are eagerly initialized, but "S" is not contained
in `variables_order`, `TRACK_VARS_SERVER` is created as empty array
with refcount > 1.  Since this hash table may later be modified, a flag
is set which allows such COW violations for assertions.  However, when
`register_argc_argv` is on, the so far uninitialized hash table is
updated with `argv`, what causes the hash table to be initialized, what
drops the allow-COW-violations flag.  The following update with `argc`
then triggers a refcount violation assertion.

Since we consider `HT_ALLOW_COW_VIOLATION` a hack, we do not want to
keep the flag during hash table initialization, so we initialize the
hash table right away after creation for this code path.

Closes GH-15930.
2024-09-26 15:33:35 +02:00
Ilija Tovilo
91c06790de Switch asan build to Ubuntu 24.04
Closes GH-16065
2024-09-26 15:13:35 +02:00
Dmitry Stogov
8b7f64fa41 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix possible NULL dereference
2024-09-26 15:44:05 +03:00
Dmitry Stogov
24d5912a30 Fix possible NULL dereference 2024-09-26 15:43:42 +03:00
Christoph M. Becker
70eb8f06ed Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix bug71610.phpt
2024-09-26 13:16:36 +02:00
Christoph M. Becker
de51612ba5 Fix bug71610.phpt
Apparently example.org now rejects POST requests, so we would need to
adjust the test expectation ("Method not allowed").  However, there is
no need for an online test; instead we're just using the CLI test
server.  The serialization is a bit fiddly, but as long as there are
no quotes in `PHP_CLI_SERVER_ADDRESS` we're fine.

Closes GH-16063.
2024-09-26 13:16:00 +02:00
Gina Peter Banyard
459486a7db Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/ldap: Fix GH-16032 (Various NULL pointer dereferencements in ldap_modify_batch())
2024-09-25 23:26:31 +01:00
Gina Peter Banyard
f4c45ee376 ext/ldap: Fix GH-16032 (Various NULL pointer dereferencements in ldap_modify_batch())
We check that the "attrib" and "modtype" keys are present in each array.
If not we throw a ValueError, in line with what other validation failure cases do.

Closes GH-16057
2024-09-25 23:23:56 +01:00
Niels Dossche
fdd6ba62bb Fix GH-16054: Segmentation fault when resizing hash table iterator list while adding
zend_array_dup_ht_iterators() loops over the hash table iterators and
can call zend_hash_iterator_add(). zend_hash_iterator_add() can resize
the array causing a crash in zend_array_dup_ht_iterators().

We solve this by refetching the iter pointer after an add happened.

Closes GH-16060.
2024-09-25 21:05:05 +02:00