1
0
mirror of https://github.com/php/php-src.git synced 2026-04-13 02:52:48 +02:00
Commit Graph

126538 Commits

Author SHA1 Message Date
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
Dmitry Stogov
88cb659f1f Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fix incorrect type store elimination
2021-12-17 12:32:49 +03:00
Dmitry Stogov
66306030ad JIT: Fix incorrect type store elimination
Fixes oss-fuzz #42388
2021-12-17 12:31:48 +03:00
Christoph M. Becker
5910e1d6cd Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81679: Tracing JIT crashes on reattaching
2021-12-15 15:39:58 +01:00
Christoph M. Becker
49380b59d2 Fix #81679: Tracing JIT crashes on reattaching
When a new process reattaches to OPcache, tracing JIT causes segfaults,
because each new process allocates its own `zend_jit_traces` and
`zend_jit_exit_groups` in SHM, although these need to be shared between
all processes.

We solve that by only allocating these structs for the first process,
and store the pointers in `accel_shared_globals`, so we can reassign
them when a new process reattaches.

Closes GH-7776.
2021-12-15 15:37:23 +01:00
Dmitry Stogov
75b2973974 Fix array clobbering by user error handler
Fixes oss-fuzz #42363
2021-12-15 12:20:37 +03:00
Dmitry Stogov
b16fc350a4 Move common code into helper 2021-12-14 15:31:53 +03:00
Dmitry Stogov
1a6863c6af Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Preloading: don't remove INCLUDE_OE_EVAL nstructions with used result
2021-12-14 11:37:25 +03:00
Dmitry Stogov
cd8e6f5f7b Preloading: don't remove INCLUDE_OE_EVAL nstructions with used result 2021-12-14 11:36:33 +03:00
Dmitry Stogov
1e56b64759 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Combine ADDREF/DELREF
2021-12-13 22:54:45 +03:00
Dmitry Stogov
c787f42ceb Combine ADDREF/DELREF 2021-12-13 22:38:23 +03:00
Dmitry Stogov
0314f40c2d Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Tracing JIT: Fix reference counting
2021-12-13 16:34:32 +03:00
Dmitry Stogov
fe320e83ae Tracing JIT: Fix reference counting
Fixes oss-fuzz #42225
2021-12-13 16:28:45 +03:00
Dmitry Stogov
76075823e7 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix array clobering by user error handler
2021-12-13 15:20:16 +03:00
Dmitry Stogov
cbc0b1afeb Fix array clobering by user error handler
Fixes oss-fuzz #42234
2021-12-13 14:59:30 +03:00
Dmitry Stogov
f8f0a650a7 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix incorrect optimization that leads to memory leak
2021-12-13 13:09:05 +03:00
Dmitry Stogov
230de7721f Fix incorrect optimization that leads to memory leak
Fixes oss-fuzz #42221
2021-12-13 13:08:05 +03:00
Dmitry Stogov
1f03debb68 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fix crash during compilation of function with incompletely constructed SSA
2021-12-13 11:51:41 +03:00
Dmitry Stogov
e79dbe1124 JIT: Fix crash during compilation of function with incompletely constructed SSA
Fixes oss-fuzz #42200
2021-12-13 11:49:51 +03:00
Christoph M. Becker
c35be03628 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7765: php_oci_cleanup_global_handles segfaults at second call
2021-12-12 22:38:55 +01:00
Christoph M. Becker
c435e67746 Fix GH-7765: php_oci_cleanup_global_handles segfaults at second call
We must not use the TSRM accessor macros in GINIT and GSHUTDOWN, but
rather use the passed pointers directly.  For simplicity, we inline
`php_oci_cleanup_global_handles()`, and also the `PHP_OCI_CALL()`
macros; the latter are unlikely to be needed here, but don't hurt.

Closes GH-7766.
2021-12-12 22:38:00 +01:00
Christoph M. Becker
206c521a1f Fix GH-7757: Multi-inherited final constant causes fatal error
"Diamond" inheritance of final constants is supposed to be supported.

Closes GH-7767.
2021-12-12 22:22:51 +01:00
Christoph M. Becker
577358b8d2 [ci skip] Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  macOS 10.14 runners are no longer available via Azure Pipeline
2021-12-12 19:17:37 +01:00
Christoph M. Becker
9998082a6a [ci skip] Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  macOS 10.14 runners are no longer available via Azure Pipeline
2021-12-12 19:16:48 +01:00
Christoph M. Becker
6d5f2ba78d macOS 10.14 runners are no longer available via Azure Pipeline
These images have already been deprecated for two months[1].  Thus,
we upgrade to macOS 10.15.  Since clang 12 is picky about
`int-in-bool-context` warning, we disable `-Werror`.

[1] <https://devblogs.microsoft.com/devops/hosted-pipelines-image-deprecation/>
2021-12-12 19:11:21 +01:00
Christoph M. Becker
a708db9c8a Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7759: Incorrect return types for hash() and hash_hmac()
2021-12-12 15:47:19 +01:00
Christoph M. Becker
0b3a937670 Fix GH-7759: Incorrect return types for hash() and hash_hmac()
`hash()` and `hash_hmac()` never return `false`; only `hash_file()` and
`hash_hmac_file()` return `false` in case the data cannot be read.

Closes GH-7760.
2021-12-12 15:39:55 +01:00
Christoph M. Becker
926dee1b6f Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix error message allocation of PDO PgSQL
2021-12-12 15:18:32 +01:00
SATO Kentaro
778513f605 Fix error message allocation of PDO PgSQL
Closes GH-7723.
2021-12-12 15:17:36 +01:00
Christoph M. Becker
f19250a3a1 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix openssl_x509_checkpurpose_basic.phpt
2021-12-12 14:28:16 +01:00
Christoph M. Becker
2c2b0abd4a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix openssl_x509_checkpurpose_basic.phpt
2021-12-12 14:27:07 +01:00
Christoph M. Becker
98175fc7f1 Fix openssl_x509_checkpurpose_basic.phpt
This test fails because san-cert.pem and san-ca.pem have expired.  We
fix that by using the CertificateGenerator to generate temporary certs
during the test run.  Since san-cert.pem and san-ca.pem have been
identical, we only generate one certificate.

Closes GH-7763.
2021-12-12 14:26:17 +01:00
Christoph M. Becker
7daf01258d Fix GH-7748: gethostbyaddr outputs binary string
`getnameinfo(3)` returns zero on success; all other values need to be
regarded as failure.
2021-12-10 17:38:36 +01:00
Dmitry Stogov
cfcee97ad6 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Remove range inference for booleans.
2021-12-10 14:33:36 +03:00
Dmitry Stogov
6f42c073cf Remove range inference for booleans.
Range inference for bolleans and longs comparison was incorrect.

Fizes oss-fuzz #fuzz-42161.php
2021-12-10 14:32:47 +03:00
Christoph M. Becker
2362722dcf Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81585: cached_chunks are not counted to real_size on shutdown
2021-12-10 12:25:44 +01:00
Christoph M. Becker
5675ebe649 Fix #81585: cached_chunks are not counted to real_size on shutdown
The amount of allocated system memory is kept in `real_size`, including
the allocated `cached_chunks`.  Thus, we need to keep the proper count
at the end of the shutdown.

Closes GH-7745.
2021-12-10 12:24:06 +01:00
Dmitry Stogov
363434bab2 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix incorrect JMP optimization
2021-12-10 01:44:55 +03:00