1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 06:51:18 +02:00
Commit Graph

123020 Commits

Author SHA1 Message Date
Dmitry Stogov
76b3635607 unserialize() optimization. Omit class name validation before hash lookup, and perform it only before autoloading. 2021-02-17 13:30:52 +03:00
Dmitry Stogov
5c78e87399 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80745 (JIT produces Assert failure and UNKNOWN:0 var_dumps in code involving bitshifts)
2021-02-17 11:51:50 +03:00
Dmitry Stogov
7f68a7afe6 Fixed bug #80745 (JIT produces Assert failure and UNKNOWN:0 var_dumps in code involving bitshifts) 2021-02-17 11:51:13 +03:00
Nikita Popov
bbb86ba7e2 Merge branch 'PHP-8.0'
* PHP-8.0:
  Remove generated zend_jit_x86.c on `make clean`
2021-02-17 09:45:31 +01:00
Dylan T
408272b8d9 Remove generated zend_jit_x86.c on make clean
Not removing this causes build failure when reconfiguring and rebuilding after a `make clean`, e.g. enabling/disabling ZTS.

This makes https://bugs.php.net/bug.php?id=80561 more bearable. Ideally it would be rebuilt automatically on configuration change if necessary, but I have no idea how to implement this.

Closes GH-6702.
2021-02-17 09:45:12 +01:00
Dmitry Stogov
319f73e06b Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80742 (Opcache JIT makes some boolean logic unexpectedly be true)
2021-02-16 20:02:48 +03:00
Dmitry Stogov
fad87a24da Fixed bug #80742 (Opcache JIT makes some boolean logic unexpectedly be true) 2021-02-16 20:02:12 +03:00
Máté Kocsis
803779e84b Add support for generating properties with union type of multiple classes
Closes GH-6701
2021-02-16 15:50:13 +01:00
Nikita Popov
6bfe1aa19a Merge branch 'PHP-8.0'
* PHP-8.0:
  Handle incomplete result set metadata more gracefully
2021-02-16 15:35:01 +01:00
Nikita Popov
edb9229b8b Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Handle incomplete result set metadata more gracefully
2021-02-16 15:34:47 +01:00
Nikita Popov
9552cf6b84 Handle incomplete result set metadata more gracefully
Rather than segfaulting because sname is missing lateron, report
a FAIL here. As this indicates a server bug, the errors is reported
as an out of band warning, rather than a client error.

This fixes the PHP side of bug #80713.
2021-02-16 15:34:14 +01:00
Máté Kocsis
cad66533f0 Generate class entries from stubs for ldap, libxml, mbstring and mysqli
Closes GH-6684
2021-02-16 14:46:19 +01:00
Nikita Popov
8b4ae72efb Fix unused variable warning 2021-02-16 14:24:58 +01:00
Nikita Popov
ce0bc58c22 Merge branch 'PHP-8.0'
* PHP-8.0:
  Mark resource-like objects as non-comparable
2021-02-16 14:22:03 +01:00
Nikita Popov
b63ea1047a Mark resource-like objects as non-comparable
As these hold on to some internal resource, there can't be two
"equal" objects with different identity. Make sure the lack of
public properties doesn't result in these being treated as always
equal.
2021-02-16 14:20:45 +01:00
Dmitry Stogov
081349fe16 Improved unserialize() performance. Checks for object propery "visibility change" were moved, to be performed only if name/visibility had been really changed. 2021-02-16 15:27:58 +03:00
Máté Kocsis
bf0f6aaf18 Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Nikita Popov
1f04f162a6 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80723
2021-02-16 12:34:00 +01:00
Nikita Popov
cb9785add1 Fixed bug #80723
This fixes the issue just for the Socket class. Presumably we'll
want to do the same for other "resource" objects.
2021-02-16 12:33:50 +01:00
Derick Rethans
2fe6df771f Merge branch 'PHP-8.0' 2021-02-16 11:31:53 +00:00
Derick Rethans
2dc75a9e93 Merge branch 'PHP-7.4' into PHP-8.0 2021-02-16 11:31:43 +00:00
Derick Rethans
2d858fbfb1 Fixed dates 2021-02-16 11:31:34 +00:00
Derick Rethans
e3bb2c9d9a Merge branch 'PHP-8.0' 2021-02-16 11:27:24 +00:00
Derick Rethans
f73e419996 Merge branch 'PHP-7.4' into PHP-8.0 2021-02-16 11:27:17 +00:00
Derick Rethans
6d3d9104e6 PHP-7.4 is now 7.4.17-dev 2021-02-16 11:26:47 +00:00
Dmitry Stogov
f8cf7152a9 Microoptimization of STRLEN and IN_ARRAY opcodes (based on https://github.com/php/php-src/pull/4981) 2021-02-16 14:11:47 +03:00
Nikita Popov
eb8ad30cf1 Fix quadratic slowdown under asan in timelib
This is a hotfix for https://github.com/derickr/timelib/pull/94
until the issue is resolved upstream.
2021-02-16 11:56:17 +01:00
Florian Sowade
c4d508c2bc Add dependency tracking for header files
This ensures all .c files which include a header file directly or
indirectly are rebuilt whenever the header file is changed.

Closes GH-6693.
2021-02-16 10:50:03 +01:00
Alexander Moskalev
e727919b97 cURL: make possible to send file from buffer string
Add CURLStringFile class which works similarly to CURLFile, but
uploads a file from a string rather than a file. This avoids the
need to create a temporary file, or use of a data:// stream.

Basic usage:

    $file = new CURLStringFile($data, 'filename.txt', 'text/plain');
    curl_setopt($curl, CURLOPT_POSTFIELDS, ['file' => $file]);

Closes GH-6456.
2021-02-16 10:24:22 +01:00
Nikita Popov
d16341dabe Merge branch 'PHP-8.0'
* PHP-8.0:
  Increase timeout on asan job
2021-02-16 10:16:13 +01:00
Nikita Popov
2d7ada2c0b Increase timeout on asan job
Regularly runs against the 5:10 hour limit on master. Increase it
to 6:00 hours.
2021-02-16 10:15:08 +01:00
Nikita Popov
45e6dc7beb Merge branch 'PHP-8.0'
* PHP-8.0:
  Suppress OpenSSL error on missing optional config
2021-02-16 10:12:59 +01:00
Nikita Popov
4fb8252186 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Suppress OpenSSL error on missing optional config
2021-02-16 10:12:42 +01:00
Nikita Popov
7566742754 Suppress OpenSSL error on missing optional config
openssl_pkey_new() fetches various options from the config file --
most of these are optional, and not specifying them is not an error
condition from the perspective of the user. Unfortunately, the
CONF_get_string() API pushes an error when accessing a key that
doesn't exist (_CONF_get_string does not, but that is presumably a
private API). This commit adds a helper php_openssl_conf_get_string()
that automatically clears the error in this case. I've found that
OpenSSL occasionally does the same thing internally:
22040fb790/apps/req.c (L515-L517)

Closes GH-6699.
2021-02-16 10:11:00 +01:00
Nikita Popov
353f7ffb6b Delref only after successful allocation
Otherwise we may have inconsistent refcounts after OOM.

I expect this problem is much more prevalent, but this at least
fixes some string/array separation cases.

Fixes oss-fuzz #30999.
2021-02-16 10:01:46 +01:00
Christoph M. Becker
0cdc634fc4 Merge branch 'PHP-8.0'
* PHP-8.0:
  Adapt test case for libcurl 7.75.0+
2021-02-16 00:30:03 +01:00
Christoph M. Becker
afe17cc1b6 Adapt test case for libcurl 7.75.0+
libcurl 7.75.0 finally adds support for `gophers://`, i.e. gopher over
TLS.  The protocol is neither standardized, nor is the protocol
registered with IANA, but well, it is there and the test case should
cater to that.
2021-02-16 00:28:34 +01:00
Nikita Popov
5f0b995e6c Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80747
2021-02-15 15:34:54 +01:00
Nikita Popov
f43097a2d7 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80747
2021-02-15 15:34:21 +01:00
Nikita Popov
64b1085464 Fixed bug #80747
If RSA key generation fails, actually report that failure.
2021-02-15 15:34:01 +01:00
Nikita Popov
e70f1b0488 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix symtable cache being used while cleaning symtable
2021-02-15 14:59:07 +01:00
Nikita Popov
882862563a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix symtable cache being used while cleaning symtable
2021-02-15 14:58:59 +01:00
Nikita Popov
7b7d99839c Fix symtable cache being used while cleaning symtable
We need to first clean the symtable and then check whether a cache
slot is available for it. Otherwise, it may happen that a destructor
runs while cleaning the table and uses up all the remaining slots
in the cache.

This is particularly insidious because once we overflow the cache,
the first pointer we modify is symtable_cache_ptr, making it hard
to understand what happened after the fact.

Fixes oss-fuzz #30815.
2021-02-15 14:58:38 +01:00
Nikita Popov
643a727c37 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix assertion failure in cufa optimization with named args
2021-02-15 12:43:50 +01:00
Nikita Popov
c70220205e Fix assertion failure in cufa optimization with named args
Fixes oss-fuzz#30764.
2021-02-15 12:43:31 +01:00
Nikita Popov
c91ea947b2 Use typed proprety for Transliterator::$id
This is a read-only property for which Transliterator internally
assigns a string value.

Also clean up the code handling this property a bit.
2021-02-15 12:27:25 +01:00
Nikita Popov
2ccf630917 Used typed properties for reflection $name and $class
These are read-only properties, and Reflection makes sure to assign
only strings.
2021-02-15 12:09:18 +01:00
Máté Kocsis
a730dc0cf9 Generate class entries for snmp, soap, sockets, sodium, sqlite3, sysv*, tidy
Closes GH-6696
2021-02-15 11:45:26 +01:00
Nikita Popov
f01ad22bab Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #78680: mysqlnd pam plugin missing terminating null
2021-02-15 11:33:01 +01:00
Nikita Popov
8b9dd0a301 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #78680: mysqlnd pam plugin missing terminating null
2021-02-15 11:32:54 +01:00