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

135113 Commits

Author SHA1 Message Date
Christoph M. Becker
11da498add Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fail early in *nix configuration build script
2024-11-09 14:05:38 +01:00
Hans Krentel (hakre)
c075546320 Fail early in *nix configuration build script
Adding two exit early safeguards in the *nix configuration build script:

1) Given the initial cd into the build tree fails (the project root),
   the `buildconf` script exits with non-zero status (failure).
2) Given the grep command does not exist or `configure.ac` AC_INIT [1]
   expectations are unmet, the buildconf script exits non-zero.

Additionally quoting the pathname to cd into and the empty CD_PATH
parameter for portability, also for systems that are using a
non-portable pathname [2] for the build tree.

The initial CD safeguard has been applied to the `buildconf` and
four more scripts:

- build/genif.sh
- scripts/dev/credits
- scripts/dev/genfiles
- scripts/dev/makedist

Rationale:

Cd-ing into the project root should always prematurely exit w/ FAILURE
as a required precondition for its invocation has not been met. This
should never go unnoticed as it always requires user intervention.

Similar and more specifically to the PHP build on *nix systems, the
grep command is required early to obtain the `php_extra_version` from
configure.ac.  Previously, if the grep command is missing (or failing
due to not matching the line with the AC_INIT macro [1]), the internal
dev parameter would always be zero (0) which can easily result in the
situation that the configure script is not being rebuilt. This is
cumbersome as the rebuild of a configure script is more likely required
with checked-out dev versions under change rather than an already
properly set-up build environment on a dedicated build or release
system. Missing the fact that either the grep utility is missing or
the expectation of having the AC_INIT macro in configure.ac is unmet
should never go unnoticed as it always requires user intervention.

[1]: https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Initializing-configure.html
[2]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_271

Closes GH-16717.
2024-11-09 14:03:04 +01:00
Niels Dossche
80dd5a0306 Fix wrong merge 2024-11-09 11:49:08 +01:00
Niels Dossche
591fe92724 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix memory leak in php_openssl_pkey_from_zval()
  Fix various memory leaks related to openssl exports
  Prevent unexpected array entry conversion when reading key
2024-11-09 11:01:21 +01:00
Niels Dossche
994e866cf2 Fix memory leak in php_openssl_pkey_from_zval()
Closes GH-16691.
2024-11-09 10:58:44 +01:00
Niels Dossche
2f4f09f7e6 Fix various memory leaks related to openssl exports
Closes GH-16692.
2024-11-09 10:58:17 +01:00
Niels Dossche
ac8d0e57d9 Prevent unexpected array entry conversion when reading key
When passing an array, the key entry can get converted to a string if it
is an object, but this actually modifies the original array entry.
The test originally outputted:

```
array(2) {
  [0]=>
  string(...) => ...
  [1]=>
  string(0) ""
}
```

This is unexpected. Use zval_try_get_string() to prevent this behaviour.

Closes GH-16693.
2024-11-09 10:57:50 +01:00
Maximilian Bosch
73c4fa0ea4 ext/soap: fix make check being invoked in ext/soap
On NixOS we run `make` & `make check` inside `ext/soap` which broke the test
like this:

    001+ Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'ext/soap/tests/gh15711.wsdl' : failed to load "ext/soap/tests/gh15711.wsdl": No such file or directory
    002+  in /build/php-8.3.13/ext/soap/tests/gh15711.php:29
    003+ Stack trace:
    004+ #0 /build/php-8.3.13/ext/soap/tests/gh15711.php(29): SoapClient->__construct('ext/soap/tests/...', Array)
    005+ #1 {main}
    006+   thrown in /build/php-8.3.13/ext/soap/tests/gh15711.php on line 29

Fix is to make the path dependant on `__DIR__` as it's the case in other
testcases including WSDLs.

Closes GH-16733.
2024-11-08 20:47:28 +01:00
Jakub Zelenka
af8ebb12ca Merge branch 'PHP-8.2' into PHP-8.3 2024-11-08 16:48:25 +01:00
Jakub Zelenka
065bde1e13 Fix GH-16432: PHP-FPM 8.2 SIGSEGV in fpm_get_status 2024-11-08 16:44:05 +01:00
David Carlier
61b4e67fb1 Merge branch 'PHP-8.2' into PHP-8.3 2024-11-08 12:27:24 +00:00
David Carlier
875a9dc4c4 Fix introduced leaks from GH-15715.
Choosing here to shrink the requested allocation to its max value.
2024-11-08 12:27:03 +00: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
David Carlier
3f28644fff Merge branch 'PHP-8.2' into PHP-8.3 2024-11-07 22:52:19 +00:00
David Carlier
e74e66e3f7 Fix oss-fuzz report triggered by GH-15712 commit.
It triggered allocation overflow which, even fixed, in turn gives memory
leak on 32 bits but the allocator relies on signed integers.

close GH-15915
2024-11-07 22:51:05 +00:00
Christoph M. Becker
fb6d500457 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Skip tests if ldap_set_rebind_proc() is not available
2024-11-07 13:22:54 +01:00
Christoph M. Becker
d276ea54f4 Skip tests if ldap_set_rebind_proc() is not available
This is already done by ldap_set_rebind_proc_error.phpt, but not by the
other two affected tests.

Closes GH-16708.
2024-11-07 13:22:17 +01:00
David Carlier
d59b07f9bd Merge branch 'PHP-8.2' into PHP-8.3 2024-11-06 12:52:56 +00:00
David Carlier
fde053bb92 Fix GH-16235 jdtogregorian overflow
close GH-16242
2024-11-06 12:52:32 +00:00
Saki Takamachi
ca27e40a5f Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Added gc_handler to properly handle circular references. (#16703)
2024-11-06 20:31:30 +09:00
Saki Takamachi
4d14325b19 Added gc_handler to properly handle circular references. (#16703)
closes #16703

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2024-11-06 20:30:08 +09:00
Niels Dossche
9a255b384f Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix test with shared zend_test (#16705)
2024-11-05 21:36:41 +01:00
Niels Dossche
3f1ea1b663 Fix test with shared zend_test (#16705) 2024-11-05 21:35:47 +01:00
Pierrick Charron
cf2dc976e6 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  PHP-8.2 is now for PHP 8.2.27-dev
2024-11-05 12:48:30 -05:00
Pierrick Charron
f5895792e7 PHP-8.2 is now for PHP 8.2.27-dev 2024-11-05 12:47:25 -05:00
Eric Mann
9c79ca74ef PHP-8.3 is now for PHP-8.3.15-dev 2024-11-05 07:00:09 -08:00
Niels Dossche
673e8d1011 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix various memory leaks on error conditions in openssl_x509_parse()
2024-11-04 20:04:18 +01:00
Niels Dossche
5ddb75660d Fix various memory leaks on error conditions in openssl_x509_parse()
Closes GH-16690.
2024-11-04 20:03:53 +01:00
Ilija Tovilo
dca438e6a3 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add NEWS entry
  Also fix same issue in ArrayObject::exchangeArray()
  Fix use-after-free in ArrayObject::unset() with destructor
2024-11-04 17:47:49 +01:00
Ilija Tovilo
418f820f5d Add NEWS entry 2024-11-04 17:46:17 +01:00
Ilija Tovilo
f7222bd2de Also fix same issue in ArrayObject::exchangeArray() 2024-11-04 17:46:17 +01:00
Ilija Tovilo
8910ac800d Fix use-after-free in ArrayObject::unset() with destructor
Fixes GH-16646
Closes GH-16653
2024-11-04 17:45:56 +01:00
Ilija Tovilo
745684290e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Postpone zend_array_sort() in ext-intl
  Use bool for zend_array_sort()
2024-11-04 16:02:16 +01:00
Ilija Tovilo
845cdbce67 Postpone zend_array_sort() in ext-intl
This function is not ZEND_API yet, so we cannot use it as it won't work for
dynamically linked extensions.
2024-11-04 16:01:00 +01:00
Ilija Tovilo
4b9e59b430 [skip ci] Use bool for zend_array_sort()
zend_bool is removed in higher branches.
2024-11-04 15:59:18 +01:00
Ilija Tovilo
f033cf75e4 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix array going away during sorting
2024-11-04 15:51:03 +01:00
Ilija Tovilo
2bdce61390 Fix array going away during sorting
Fixes GH-16648
Closes GH-16654
2024-11-04 15:50:35 +01:00
Ilija Tovilo
5852c89034 [skip ci] Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Fix nightly workflow dispatch
2024-11-04 15:03:58 +01:00
Ilija Tovilo
2985de72db [skip ci] Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Fix nightly workflow dispatch
2024-11-04 15:03:47 +01:00
Ilija Tovilo
e72854e8bc [skip ci] Fix nightly workflow dispatch
Closes GH-16662
2024-11-04 15:02:11 +01:00
David Carlier
b28ded42eb Merge branch 'PHP-8.2' into PHP-8.3 2024-11-03 13:39:41 +00:00
David Carlier
90aac521fd Fix GH-16592 msg_send() crashes when the type does not serialize as expected.
It is assumed that the serialization always had initialised its buffer
zend_string, but in the case of a type not serialising, it is null.

close GH-16599
2024-11-03 13:39:24 +00:00
Niels Dossche
16cda10650 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16628: FPM logs are getting corrupted with this log statement
  Fix GH-16601: Memory leak in Reflection constructors
2024-11-02 19:37:28 +01:00
Niels Dossche
e643129bbb Fix GH-16628: FPM logs are getting corrupted with this log statement
zlog_buf_prefix() can return a larger length than what actually was
written due to its use of snprintf(). The code in
zlog_stream_prefix_ex() does not take this into account, other callers
do. What ends up happening then is that stream->length is set to the
length as if snprintf() was able to write all bytes, causing
stream->length to become larger than stream->buf.size, causing a
segfault.

In case the buffer was too small we try with a larger buffer up to a
limit of zlog_limit. This makes sure that the stream length will remain
bounded by the buffer size.

This also adds assertions to make the programmer intent clear and catch
this more easily in debug builds.

Closes GH-16680.
2024-11-02 19:36:20 +01:00
Niels Dossche
f0f666ba3f Fix GH-16601: Memory leak in Reflection constructors
Additionally fixes wrong behaviour in ReflectionParameter when you first
have a construction that uses an object and the subsequent doesn't.

Closes GH-16672.
2024-11-02 19:35:20 +01:00
Gina Peter Banyard
65d42342a1 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/gmp: Fix segfault when null is encountered on an overloaded operator
  ext/gmp: Add behavioural tests for operator overloading
2024-11-02 17:40:41 +00:00
Gina Peter Banyard
5253647500 ext/gmp: Fix segfault when null is encountered on an overloaded operator
And various other issues like inconsistent type errors

Closes GH-16015
2024-11-02 17:36:32 +00:00
Gina Peter Banyard
fe02fd5095 ext/gmp: Add behavioural tests for operator overloading 2024-11-02 17:32:43 +00:00
Christoph M. Becker
8df513336a Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14732: date_sun_info() fails for non-finite values
2024-11-01 23:47:21 +01:00