1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 22:41:20 +02:00
Commit Graph

125367 Commits

Author SHA1 Message Date
Nikita Popov
de6cf68ac4 Fix missing string copy
I changed this to a zend_string_copy, but that's not correct in
this case, as we still append to the string below.

Also fix a test on 32-bit.
2021-08-20 14:15:23 +02:00
Nikita Popov
50484b59cd Move derefs into accessor macros
These derefs are mostly there to be defensive, but clutter the
code somewhat. Move them directly into the access macros.
2021-08-20 14:15:23 +02:00
Kamil Tekiela
a893a4901f Implement mysqlnd_set_persistent_string (#7371) 2021-08-20 12:03:46 +01:00
Nikita Popov
6b05d958aa Make internal SoapServer/SoapClient state private
This was previously implicitly public due to the use of dynamic
properties. Make this internal state private.

If someone complains, we can consider relaxing this to protected
or public on a case-by-case basis.
2021-08-20 12:54:39 +02:00
Nikita Popov
e6c6abf6b4 Declare remaining SoapClient properties 2021-08-20 12:50:19 +02:00
Nikita Popov
b3b1658492 Remove dead code
This was checking for the headerfault property, but not actually
doing anything with it.
2021-08-20 12:28:58 +02:00
Nikita Popov
aa4898ef2e Use separate property to request digit auth
Currently, _digest is used both to request that digest auth be
used (_digest == null) and to later store the _digest parameters.

This relies on the ability to distinguish between _digest being
null and it being not set, which is not present with declared
properties. (Well, technically it is, we could just leave it
uninitialized, but that would be non-idiomatic.)

Resolve this by splitting into separate _use_digest and _digest
properties.
2021-08-20 10:41:36 +02:00
Nikita Popov
32d663e198 Declare SoapFault properties 2021-08-20 10:08:22 +02:00
Nikita Popov
44befbdc01 Don't convert Error exception to SoapFault
Error exceptions should generally not be converted into domain-
specific exception types. They indicate programming errors that
should not be handled locally.
2021-08-20 10:06:11 +02:00
Nikita Popov
018cb891cf Declare some SoapClient properties
This is only a subset of all properties for now (those without
underscore).
2021-08-19 16:15:41 +02:00
Nikita Popov
e861cb5c31 Simplify some strtolower operations in ext/soap 2021-08-19 16:10:30 +02:00
Nikita Popov
e6d4b3077d Simplify constructor invocation in ext/soap
Use ce->constructor and zend_call_known_instance_method. There
is no need to look up a method with the same name as the class
anymore.
2021-08-19 16:04:43 +02:00
Nikita Popov
7d4f2f5392 Declare SoapHeader properties 2021-08-19 14:27:09 +02:00
Nikita Popov
bdf8b9ed2d Declare SoapServer::$service property 2021-08-19 14:10:21 +02:00
Nikita Popov
c58c926034 Declare SoapVar properties 2021-08-19 12:35:37 +02:00
Nikita Popov
030bb36ed7 Declare SoapParam properties 2021-08-19 11:48:56 +02:00
Nikita Popov
6cc4e3280e Only assign $severity for ErrorException
This code is used by generic EH_THROW with arbitrary Exception
types, while only ErrorException has a $severity property. We
don't want this code to add $severity properties to random
exception types like PDOException.
2021-08-19 11:05:08 +02:00
Nikita Popov
29c6eb6cf5 Declare Directory properties
Some error handling test changes, as changes to the $handle
property are now detected earlier.
2021-08-19 10:39:23 +02:00
hassan
7e84b1ee00 Fix path printing in ext_skel (#7387) 2021-08-19 09:43:32 +02:00
Bob Weinand
1440d15e00 Add missing zend_test requirement to ffi test for bug80847 2021-08-18 17:16:54 +02:00
Christoph M. Becker
eaa3532b04 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #78819: Heap Overflow in msg_send
2021-08-18 16:39:36 +02:00
Christoph M. Becker
465b3ab2f9 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #78819: Heap Overflow in msg_send
2021-08-18 16:37:58 +02:00
Christoph M. Becker
9494b1cdc4 Fix #78819: Heap Overflow in msg_send
We need to use the proper type.

Closes GH-7386.
2021-08-18 16:35:16 +02:00
Christoph M. Becker
7c53e7def8 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #73122: Integer Overflow when concatenating strings
2021-08-18 14:54:29 +02:00
Christoph M. Becker
d71a0dcc76 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #73122: Integer Overflow when concatenating strings
2021-08-18 14:52:59 +02:00
Christoph M. Becker
0b7dffb41f Fix #73122: Integer Overflow when concatenating strings
We must avoid integer overflows in memory allocations, so we introduce
an additional check in the VM, and bail out in the rare case of an
overflow.

Closes GH-7381.
2021-08-18 14:49:09 +02:00
Nikita Popov
a991fe51f8 Test file cache mix (file -> shm) 2021-08-18 14:24:46 +02:00
Nikita Popov
ba8e5d336b Merge branch 'PHP-8.0'
* PHP-8.0:
  Test file_cache prime shm + use file combination
  Fix repeated file cache unserialization of zval string
2021-08-18 12:39:47 +02:00
Nikita Popov
3454ea36a4 Test file_cache prime shm + use file combination
We're currently only testing prime shm + use shm and prime file +
use file.

This adds testing for the prime shm + use file combination. The
prime file + use shm combination is broken on PHP-8.0, so not
tested.
2021-08-18 12:38:36 +02:00
Nikita Popov
de7ba3e737 Fix repeated file cache unserialization of zval string
The IS_UNSERIALIZED check here does not work if the string is
interned (serialized with file_cache_only=0) but unserialization
happens with file_cache_only=1. In this case the unserializde
string will be in the str area after mem, which is not included
in the script size, and which is also not accessible at this
point without threading through more information. Work around
the problem by checking for the serialized representation instead.
2021-08-18 12:38:27 +02:00
MARiA so cute
aec08cc841 Improve the success rate when use mkdir() in multiprocessing environment (#7383)
Improve the success rate when use mkdir() in multiprocessing environment
2021-08-18 12:34:04 +02:00
Nikita Popov
0b98ac69d9 Merge branch 'PHP-8.0'
* PHP-8.0:
  Backport Laravel test hack
2021-08-18 09:57:38 +02:00
Nikita Popov
8f1a217a1f Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Backport Laravel test hack
2021-08-18 09:57:31 +02:00
Nikita Popov
51147e2f18 Backport Laravel test hack
The way to work around this changed, backport the version from
master.
2021-08-18 09:55:24 +02:00
Nikita Popov
e86a0a905d Assert that file cache does not contain references 2021-08-17 17:13:19 +02:00
Ben Ramsey
90a6003835 The master branch is now for 8.1.0RC1 2021-08-17 09:40:29 -05:00
Christoph M. Becker
0422b85aaf Merge branch 'PHP-8.0'
* PHP-8.0:
  Revert "Fix #73122: Integer Overflow when concatenating strings"
  Fix #73122: Integer Overflow when concatenating strings
2021-08-17 16:00:01 +02:00
Christoph M. Becker
11cb508006 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Revert "Fix #73122: Integer Overflow when concatenating strings"
  Fix #73122: Integer Overflow when concatenating strings
2021-08-17 15:58:58 +02:00
Christoph M. Becker
f3c45c1731 Revert "Fix #73122: Integer Overflow when concatenating strings"
This reverts commit f1ce8d5f58, which has
been accidentially pushed.
2021-08-17 15:57:32 +02:00
Christoph M. Becker
f1ce8d5f58 Fix #73122: Integer Overflow when concatenating strings
We must avoid integer overflows in memory allocations, so we introduce
an additional check in the VM, and bail out in the rare case of an
overflow.  Since the recent fix for bug #74960 still doesn't catch all
possible overflows, we fix that right away.
2021-08-17 15:48:58 +02:00
Nikita Popov
ddc21b0902 Fix phar test
As the REPORT_ERRORS flag is now respected, this no longer
throws a warning (in addition to the exception).
2021-08-17 14:57:17 +02:00
Nikita Popov
9574627552 Clean up recursive mkdir logic
Rewrite this as a loop with a single VCWD_MKDIR call and a
subsequent advance to the next directory.
2021-08-17 14:20:44 +02:00
Christoph M. Becker
be2df43b08 Fix #78919: CLI server: insufficient cleanup if request startup fails
We need to run the full `php_cli_server_request_shutdown()` in case of
failing `php_cli_server_request_startup()`.

Patch contributed by @cataphract.

Closes GH-7322.
2021-08-17 12:41:06 +02:00
Nikita Popov
ef5558a8cd Use zend_string for putenv key (#7379)
A zend_string will be created anyway for the hash key,
so we may as well create one in the first place.
2021-08-17 12:29:04 +02:00
Nikita Popov
2a4dba7b14 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix maybe-uninitialized warning
2021-08-17 12:27:39 +02:00
Nikita Popov
b66168e86b Fix maybe-uninitialized warning
Some GCC versions don't like zend_try in loop. Avoid the issue
by pulling it out of the loop, we don't particularly care about
skipping further warnings if a bailout occurs, just that it
does not interrupt shutdown.

Closes GH-7380.
2021-08-17 12:27:32 +02:00
Nikita Popov
3c7ff25fbe Reduce nesting in mkdir implementation 2021-08-17 12:25:38 +02:00
Christoph M. Becker
02b725a269 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #71542: disk_total_space does not work with relative paths
2021-08-17 11:32:24 +02:00
Christoph M. Becker
e45a063f4b Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #71542: disk_total_space does not work with relative paths
2021-08-17 11:31:14 +02:00
Christoph M. Becker
f924e97269 Fix #71542: disk_total_space does not work with relative paths
For ZTS builds, we need to expand the path given to `disk_free_space()`
and `disk_total_space()` to properly support the VCWD.

Closes GH-7377.
2021-08-17 11:29:33 +02:00