1
0
mirror of https://github.com/php/php-src.git synced 2026-04-12 18:43:37 +02:00
Commit Graph

126575 Commits

Author SHA1 Message Date
Christoph M. Becker
b36f25ad10 [ci skip] Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Don't truncate subsecond precision in run-tests.php JUNIT output
2021-12-27 22:30:53 +01:00
Christoph M. Becker
87d9e02f01 Don't truncate subsecond precision in run-tests.php JUNIT output
When run-tests.php has been typed[1], the type of `$time` has been
chosen to be `int`.  This, however, leads to truncation, and the
somewhat relevant subsecond precision is lost.  We fix that by
changing the type to `float`, although `int|string` would be more
appropriate, but requires PHP ≥ 7.4.0.  Another option would be to
move the `number_format()` formatting into `junit_mark_test_as()`.

[1] <11274f53e7>

Closes GH-7836.
2021-12-27 22:15:33 +01:00
Christoph M. Becker
d58c48d45d Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Revert "Fix zend_observer_fcall_end_all() accessing dangling pointers"
2021-12-27 21:10:40 +01:00
Christoph M. Becker
ee610947ce Revert "Fix zend_observer_fcall_end_all() accessing dangling pointers"
This reverts commit 76e2a8380e.  Cf.
<76e2a8380e (r62560239)>.
2021-12-27 21:08:51 +01:00
Christoph M. Becker
d4c07df4df Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix zend_observer_fcall_end_all() accessing dangling pointers
2021-12-27 18:20:48 +01:00
Florian Sowade
76e2a8380e Fix zend_observer_fcall_end_all() accessing dangling pointers
This may happen, when the execute_data was allocated on the stack.  We
ensure that the runtime cache pointer is not NULL before dereferencing
it.

This is a partial fix for bug 81430.

Closes GH-7665.
2021-12-27 18:19:13 +01:00
David Warner
f82593d597 Fix GH-7815: php_uname doesn't recognise latest Windows versions
We check `dwBuildNumber` to determine newer Windows versions.

Closes GH-7816.
2021-12-27 15:08:11 +01:00
Christoph M. Becker
187e011710 [ci skip] Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix bug40228*.phpt conflict
2021-12-26 23:28:29 +01:00
Christoph M. Becker
7f0a1e2f2d Fix bug40228*.phpt conflict
Both tests use the same directory structure; we avoid that by
extracting to separate subdirectories.

Closes GH-7831.
2021-12-26 23:23:56 +01:00
Christoph M. Becker
710dc03399 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Mark curl tests using http2.golang.org as XFAIL
2021-12-26 22:29:17 +01:00
Christoph M. Becker
5005445994 Mark curl tests using http2.golang.org as XFAIL
http2.golang.org/serverpush has been retired[1], so we need to come up
with an alternative.  Until then, we mark the relevant tests as XFAIL
(although bug77535.phpt passes, what might be an indication that the
test needs further revision).  To avoid waiting for the timeout, we
also unconditionally skip these tests for now.

[1] <https://github.com/golang/go/issues/49301>

Closes GH-7829.
2021-12-26 22:27:15 +01:00
Christoph M. Becker
0cd1741004 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Prevent strict interpretation of tentative definition
2021-12-26 16:42:33 +01:00
Christoph M. Becker
e76ddbd2f6 Prevent strict interpretation of tentative definition
This header declaration is never supposed to be interpreted as
definition; otherwise, the handlers are not properly initialized, what
happens, for instance, with ASan instrumented MSVC builds.

Closes GH-7827.
2021-12-26 16:41:25 +01:00
Christoph M. Becker
a6ddd1a14d Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7826: Inconsistent argument name in hash_hmac_file and hash_file
2021-12-26 12:59:06 +01:00
Christoph M. Becker
fd3fc5c193 Fix GH-7826: Inconsistent argument name in hash_hmac_file and hash_file
Like `hash_file()`, `hash_hmac_file()` expects a filename, and not some
string data.  Fixing this now, constitutes a (hopefully small) BC break
though.

Closes GH-7828.
2021-12-26 12:55:53 +01:00
Christoph M. Becker
9e4437f8c6 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix chunk_split_variation*_32bit.phpt for Windows
2021-12-26 12:07:07 +01:00
Christoph M. Becker
b4ba65dd9d Fix chunk_split_variation*_32bit.phpt for Windows
Both tests fail on Windows for slightly different reasons, what appears
to be legit, and as such we fix the test expectations.

Closes GH-7830.
2021-12-26 12:05:52 +01:00
Dmitry Stogov
b2939b636d Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix memory leak in SCCP
2021-12-24 13:10:58 +03:00
Dmitry Stogov
2b81156f2a Fix memory leak in SCCP
Fixes oss-fuzz #42878
2021-12-24 13:10:22 +03:00
Christoph M. Becker
0ed39ed809 Fix GH-7809: Cloning a faked SplFileInfo object may segfault
While the `path` is not supposed to be `NULL` for normal operation, it
is possible to create `SplFileInfo` objects where that is the case, and
we must not follow the null pointer.

Closes GH-7814.
2021-12-23 23:10:51 +01:00
Christoph M. Becker
9d2dc1e9a9 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Avoid void* arithmetic in sockets/multicast.c on NetBSD
2021-12-23 16:21:28 +01:00
David Carlier
3f0bb67361 Avoid void* arithmetic in sockets/multicast.c on NetBSD
On NetBSD, ifconf.ifc_buf member, unlike most of platforms, is a void
pointer.

We also fix the cpuinfo declarations with empty parameter lists.

Closes GH-7819.
2021-12-23 16:17:30 +01:00
Christoph M. Becker
d37c496735 [ci skip] Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] Update the min curl version in the sync-constants.php script
2021-12-23 13:44:23 +01:00
Christophe Coevoet
096a01c905 [ci skip] Update the min curl version in the sync-constants.php script
PHP 8.0 bumped the min curl version to 7.29.0

Closes GH-7805.
2021-12-23 13:43:32 +01:00
Christoph M. Becker
ccd7d410f1 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  $context parameter of get_headers() is nullable
2021-12-23 11:49:33 +01:00
Christoph M. Becker
c5f4ee50ab $context parameter of get_headers() is nullable
Closes GH-7813.
2021-12-23 11:47:20 +01:00
Máté Kocsis
713dcb2818 Fix the value param of SimpleXMLElement::addAttribute()
Closes GH-7811
2021-12-22 12:35:59 +01:00
Joe Watkins
938a81cf01 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  socket cmsg credential test fixes, "backporting" from the FreeBSD PR.
2021-12-21 07:28:09 +01:00
David Carlier
80b02275bb socket cmsg credential test fixes, "backporting" from the FreeBSD PR. 2021-12-21 07:27:59 +01:00
Joe Watkins
00113b95b2 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  socket: ancillary credentials build fix for non linux systems.
2021-12-21 07:25:55 +01:00
David Carlier
51647eb23e socket: ancillary credentials build fix for non linux systems.
for systems using SO_PASSCRED sockopt flag but not using ucred struct.
2021-12-21 07:25:43 +01:00
Joe Watkins
3ee2422cbb Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  zend gdb detection fix on FreeBSD.
2021-12-21 07:19:58 +01:00
David CARLIER
62bcb31706 zend gdb detection fix on FreeBSD. 2021-12-21 07:19:33 +01:00
Dmitry Stogov
01dc872b26 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed compilation warning
2021-12-21 00:03:09 +03:00
Dmitry Stogov
cb10ac1d53 Fixed compilation warning 2021-12-21 00:02:45 +03:00
Dmitry Stogov
4ffed6dbcf Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fix incorrect JIT prologur size for CLANG/x86 build
2021-12-20 23:53:50 +03:00
Dmitry Stogov
6d5922bed5 JIT: Fix incorrect JIT prologur size for CLANG/x86 build
Fixes oss-fuzz #42724
2021-12-20 23:52:46 +03:00
Alex Dowad
f07c193583 mb_convert_encoding will not auto-detect input string as UUEncode, Base64, QPrint
In a2bc57e0e5, mb_detect_encoding was modified to ensure it would never
return 'UUENCODE', 'QPrint', or other non-encodings as the "detected
text encoding". Before mb_detect_encoding was enhanced so that it could
detect any supported text encoding, those were never returned, and they
are not desired. Actually, we want to eventually remove them completely
from mbstring, since PHP already contains other implementations of
UUEncode, QPrint, Base64, and HTML entities.

For more clarity on why we need to suppress UUEncode, etc. from being
detected by mb_detect_encoding, the existing UUEncode implementation
in mbstring *never* treats any input as erroneous. It just accepts
everything. This means that it would *always* be treated as a valid
choice by mb_detect_encoding, and would be returned in many, many cases
where the input is obviously not UUEncoded.

It turns out that the form of mb_convert_encoding where the user passes
multiple candidate encodings (and mbstring auto-detects which one to
use) was also affected by the same issue. Apply the same fix.
2021-12-20 22:09:33 +02:00
Petr Sumbera
069bbf3e80 Fix zend_fibers.c build with ZEND_FIBER_UCONTEXT
Avoids (Solaris SPARC) issue:
  zend_fibers.c:77:9: error: unknown type name 'ucontext_t'

Closes GH-7773.
2021-12-20 14:21:50 +01:00
Dmitry Stogov
ca3f7b0a73 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix incorrect optimization of ASSIGN_OP that may lead to memory leak
2021-12-20 15:17:30 +03:00
Dmitry Stogov
e004e844f7 Fix incorrect optimization of ASSIGN_OP that may lead to memory leak
Fixes oss-fuzz #42506
2021-12-20 15:06:32 +03:00
Dmitry Stogov
3e842172d0 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fix register clobbering
2021-12-20 12:49:52 +03:00
Dmitry Stogov
7c674e1aa7 JIT: Fix register clobbering
Fixes oss-fuzz #42657
2021-12-20 12:48:48 +03:00
Dmitry Stogov
c8d10a8243 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix type inference for INIT_ARRAY with invalid index
2021-12-20 11:46:36 +03:00
Dmitry Stogov
f18bb2477f Fix type inference for INIT_ARRAY with invalid index
Fixes oss-fuzz #42568
2021-12-20 11:40:11 +03:00
Christoph M. Becker
3859bffcd2 [ci skip] Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  [ci skip] Fix "The Mysterious PHP RFC Process" link.
2021-12-19 16:37:09 +01:00
Joe Rowell
1481d66343 [ci skip] Fix "The Mysterious PHP RFC Process" link.
Closes GH-7785.
2021-12-19 16:35:54 +01:00
Christoph M. Becker
a000af6ecc Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix FILTER_FLAG_NO_RES_RANGE flag
2021-12-19 16:25:54 +01:00
Yifan Tong
3587e13ab3 Fix FILTER_FLAG_NO_RES_RANGE flag
`2001:10::/28` is a reserved IPv6 range. But there's a typo in GH-7476,
which caused IPv6 address like `240b:0010::1` will be filtered by the
flag `FILTER_FLAG_NO_RES_RANGE`.

http://www.faqs.org/rfcs/rfc6890.html

Closes GH-7790.
2021-12-19 16:24:34 +01:00
Dmitry Stogov
2745cd9997 Fix array clobbering by user error handler
Fixes oss-fuzz #42503
2021-12-17 12:49:58 +03:00