Commit Graph

12007 Commits

Author SHA1 Message Date
Stanislav Malyshev
c8d21d7728 [ci skip] Update NEWS 2020-03-15 19:38:31 -07:00
Christoph M. Becker
2b5fc8e325 Fix #79199: curl_copy_handle() memory leak
`curl_copy_handle()` already registers a new resource, so we must not
increase the refcount of the original resource.
2020-03-12 11:23:53 +01:00
Christoph M. Becker
7c081db885 Fix #61597: SXE properties may lack attributes and content
We must not treat a node as string if it has attributes, unless it is
an entity declaration which is always treated as string by simplexml.
2020-03-12 10:52:28 +01:00
Christoph M. Becker
53797c206a Fix #78210: Invalid pointer address
This is actually about three distinct issues:

* If an empty string is passed as $address to `stream_socket_sendto()`,
  the `sa` is not initialized, so we must not pass it as `addr` to
  `php_stream_xport_sendto()`.

* On POSIX, `recvfrom()` truncates messages which are too long to fit
  into the specified buffer (unless `MSG_PEEK` is given), discards the
  excessive bytes, and returns the buffer length.  On Windows, the same
  happens, but `recvfrom()` returns `SOCKET_ERROR` with the error code
  `WSAEMSGSIZE`.  We have to catch this for best POSIX compatibility.

* In `php_network_parse_network_address_with_port()`, we have to zero
  `in6` (not only its alias `sa`) to properly support IPv6.

Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
2020-03-11 11:30:15 +01:00
Christoph M. Becker
2462f2dab1 Fix #79364: When copy empty array, next key is unspecified
We must not forget to keep the `nNextFreeElement` when duplicating
empty arrays.
2020-03-11 08:54:05 +01:00
Christoph M. Becker
b84277297a Fix #75673: SplStack::unserialize() behavior
Even though `SplStack::unserialize()` is not supposed to be called on
an already constructed instance, it is probably better if the method
clears the stack before actually unserializing.
2020-03-06 09:09:49 +01:00
Christoph M. Becker
9dda3b9eb2 Next is 7.3.17 2020-03-03 10:19:31 +01:00
Christoph M. Becker
53140e5c56 Fix #79333: com_print_typeinfo() leaks memory
We have to free the `ansiname`s, regardless of whether they have been
put into the hashtable or not.

Since bug79299.phpt already shows the leak when run with a leak
checker, there is no need for another regression test.
2020-03-02 11:36:30 +01:00
Christoph M. Becker
2adf1c4d23 Fix #79332: php_istreams are never freed
Releasing the `com_dotnet_istream_wrapper` in `istream_destructor()` is
pointless, since `istream_destructor()` is only called when the
resource is going to be released.  This recursion is not a real issue,
though, since the resource is never exposed to userland, and has at
most refcount 1, so due to well defined unsigned integer underflow, it
never is released twice.  However, returning early in this case causes
a memory leak which needs to be fixed.
2020-03-02 10:45:37 +01:00
Nikita Popov
6c48da9a50 Fixed bug #79062
Back up the doc comment when performing heredoc scanahead.
2020-02-28 17:06:05 +01:00
Christoph M. Becker
6adb885966 Fix #79311: enchant_dict_suggest() fails on big endian architecture
For obvious reasons, we must not assign a `size_t` value to an `int`
variable using memcpy().  However, there is actually no need for the
intermediate `n_sugg_st` here, if we use the proper types in the first
place.

A regression test is not necessary, because dict_suggest.phpt already
exhibits the erroneous behavior on big endian architectures.
2020-02-28 15:43:44 +01:00
Christoph M. Becker
8654c32b58 Fix #64032: mysqli reports different client_version
While `mysqli_get_client_version()` calls `mysql_get_client_version()`
to retrieve the client version, `mysql::$client_version` is initialized
to `MYSQL_VERSION_ID`.  Both should match though, and since the former
is the more useful information, we fix `mysql::$client_version`.

We do not add a regression test, because it would usually succeed
anyway, and we already have several tests with respective `assert()`s.
2020-02-27 09:35:04 +01:00
Mark Plomer
8c6a7c3326 Fix #63206: Fully support error/exception_handler stacking, even with null or inside the handler
Always push the current user_error/exception_handler to the stack,
even when it is empty, so restore_error_handler() always works as
expected.

The user_error_handler is especially temporarily empty when we are inside
the error handler, which caused inconsistent behaviour before.
2020-02-25 12:43:42 +01:00
Miguel Xavier Penha Neto
d0d60503b5 Fixes #79265: Improper injection of Host header when using fopen for http requests
Check all occurrences of the string "host:" (and other headers),
not just the first one.
2020-02-24 09:50:32 +01:00
Christoph M. Becker
9e6358af36 Fix #79299: com_print_typeinfo prints duplicate variables
`lastid` has to retain its value during the traversal, so we move it to
an outer scope.

Patch contributed by Litiano Moura.
2020-02-23 23:31:36 +01:00
Christoph M. Becker
f133f0024e Fix #79294: ::columnType() may fail after SQLite3Stmt::reset()
The fix for feature request #53466 did not properly handle resetting of
the corresponding statement; the problem with this is that the
statement does not know about its result sets.  But even if we could
fix this, the `complete` handling still appears to be brittle, since
the `sqlite3_column_type()`docs[1] state:

| If the SQL statement does not currently point to a valid row, or if
| the column index is out of range, the result is undefined.

Fortunately, we can use `sqlite3_data_count()` instead, since[2]:

| If prepared statement P does not have results ready to return (via
| calls to the sqlite3_column() family of interfaces) then
| sqlite3_data_count(P) returns 0.

Thus, we guard `SQLite3::columnType()` with `sqlite3_data_count()`, and
completely drop updating the `php_sqlite3_result_object.complete`
field, but keep it for ABI BC purposes.

[1] <https://www.sqlite.org/c3ref/column_blob.html>
[2] <https://www.sqlite.org/c3ref/data_count.html>
2020-02-21 13:36:29 +01:00
Christoph M. Becker
ab5b6702d7 Fix NEWS [ci skip]
Cosmetics.
2020-02-20 10:55:17 +01:00
Christoph M. Becker
31dd45564c Remove extra tab in NEWS [ci skip] 2020-02-18 11:09:37 +01:00
Remi Collet
63f6608f89 bump version to 7.2.29 2020-02-18 11:00:28 +01:00
Christoph M. Becker
08073b0658 Fix #79038: PDOStatement::nextRowset() leaks column values
Firstly, we must not rely on `stmt->column_count` when freeing the
driver specific column values, but rather store the column count in
the driver data.  Since the column count is a `short`, 16 bit are
sufficient, so we can store it in reserved bits of `pdo_odbc_stmt`.

Furthermore, we must not allocate new column value storage when the
statement is not executed, but rather when the column value storage has
not been allocated.

Finally, we have to introduce a driver specific `cursor_closer` to
avoid that `::closeCursor()` calls `odbc_stmt_next_rowset()` which then
frees the column value storage, because it may be still needed for
bound columns.
2020-02-17 22:53:02 +01:00
Christoph M. Becker
16c7c71693 Fix NEWS [ci skip] 2020-02-17 19:35:42 +01:00
Christoph M. Becker
788065fb8c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS [ci skip]
2020-02-17 19:23:31 +01:00
Christoph M. Becker
5009b9811d Update NEWS [ci skip] 2020-02-17 19:21:51 +01:00
Christoph M. Becker
0966941130 Fix #79271: DOMDocumentType::$childNodes is NULL
Dom level 2 core, DOM level 3 core and the DOM living standard agree
that `childNodes` always return a `NodeList`, and never `null`.
2020-02-17 09:07:54 +01:00
Christoph M. Becker
392dada1d6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix typo in recent bugfix
2020-02-14 09:22:51 +01:00
Christoph M. Becker
8308196c97 Fix typo in recent bugfix 2020-02-14 09:21:13 +01:00
Christoph M. Becker
8ebadd1128 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77569: Write Acess Violation in DomImplementation
2020-02-13 15:15:05 +01:00
Christoph M. Becker
cec8b24c84 Fix #77569: Write Acess Violation in DomImplementation
We must not assume that the zval IS_STRING.
2020-02-13 15:13:26 +01:00
Christoph M. Becker
7b464ce6f3 Fix #79254: getenv() w/o arguments not showing changes
To be able to see changes done only with `SetEnvironmentVariable()`, we
have to use `GetEnvironmentStrings()` instead of `environ`, because the
latter sees only changes done with `putenv()`.

For best backward compatibility we're using `GetEnvironmentStringsA()`;
switching to the wide string version likely makes sense for master,
though.
2020-02-11 11:47:29 +01:00
Christoph M. Becker
f649adedfe Fix #79248: Traversing empty VT_ARRAY throws com_exception
If the `VT_ARRAY` is empty, i.e. its upperbound is less than its lower
bound, we must not call `php_com_safearray_get_elem()`, because that
function throws in this case.
2020-02-08 17:05:29 +01:00
Christoph M. Becker
b9738f5802 Fix #79242: COM error constants don't match com_exception codes
Because a `HRESULT` is a `LONG`[1], no special treatment is required on
x86 platforms to get appropriate values.  On x64 platforms we prefer
positive values, what we could accomplish by casting the `HRESULT`
value to `ULONG` and then to `zend_long`, but since the current
behavior is correct and the performance improvement is negligible, we
defer that to master.

[1] <https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types#hresult>
2020-02-07 18:04:14 +01:00
Christoph M. Becker
5e2ea00b15 Fix #66322: COMPersistHelper::SaveToFile can save to wrong location
Saving under the given `filename` may also work, but since
`::LoadFromFile` uses the `fullpath` we follow suit.
2020-02-06 14:59:55 +01:00
Nikita Popov
13bfa9f5ac Fixed bug #79188 2020-02-05 11:18:46 +01:00
Christoph M. Becker
e3632fdc0d Next is 7.3.16 2020-02-04 11:38:29 +01:00
Christoph M. Becker
079905acd5 Fix #78090: bug45161.phpt takes forever to finish
Not all systems support the discard protocol (TCP port 9), and since
there is no particular reason to use it, we switch to using actual
server testing.
2020-02-04 00:44:04 +01:00
Christoph M. Becker
fe1bfb78d6 Fix #79191: Error in SoapClient ctor disables DOMDocument::save()
The culprit is the too restrictive fix for bug #71536, which prevents
`php_libxml_streams_IO_write()` from properly executing when unclean
shutdown is flagged.  A *more* suitable solution is to move the
`xmlwriter_free_resource_ptr()` call from the `free_obj` handler to an
added `dtor_obj` handler, to avoid to write to a closed stream in case
of late object freeing.  This makes the `EG(active)` guard superfluous.

We also fix bug79029.phpt which has to use different variables for the
three parts to actually check the original shutdown issue.

Thanks to bwoebi and daverandom for helping to investigate this issue.
2020-02-03 23:31:46 +01:00
Christoph M. Becker
c2935499b1 Fix #79212: NumberFormatter::format() may detect wrong type
We have to convert to number *before* detecting the type, to cater to
internal objects implementing `cast_object`.

We also get rid of the fallback behavior of using `FORMAT_TYPE_INT32`,
because that can no longer happen; after `convert_scalar_to_number_ex`
the type is either `IS_LONG` or `IS_DOUBLE`.  We cater explicitly to
the `IS_ARRAY` case what also avoids triggering a type confusion when
`::TYPE_INT64` is passed as `$type`.
2020-02-03 12:28:32 +01:00
Nikita Popov
ef1e4891b4 Fix bug #76047
Unlink the current stack frame before freeing CVs or extra args.
This means it will no longer show up in back traces that are
generated during CV destruction.

We already did this prior to destructing the object/closure,
presumably for the same reason.
2020-01-31 10:26:40 +01:00
Christoph M. Becker
8226e704e4 Fix #70078: XSL callbacks with nodes as parameter leak memory
The fix for bug #49634 solved a double-free by copying the node with
`xmlDocCopyNodeList()`, but the copied node is later freed by calling
`xmlFreeNode()` instead of `xmlFreeNodeList()`, thus leaking memory.
However, there is no need to treat the node as node list, i.e. to copy
also the node's siblings; just creating a recursive copy of the node
with `xmlDocCopyNode()` is sufficient, while that also avoids the leak.
2020-01-30 13:04:57 +01:00
Christoph M. Becker
136f51f1e1 Fix #76584: PharFileInfo::decompress not working
We actually have to decompress, when told to do so.
2020-01-28 10:31:36 +01:00
Ivan Mikheykin
fd08f062ae Fix bug #78323: Code 0 is returned on invalid options
Set CLI exit code to 1 when invalid parameters are passed,
and print error to stderr.
2020-01-27 13:32:19 +01:00
liudaixiao
67421a780d Fixed bug #78902 2020-01-23 14:57:16 +01:00
Nikita Popov
db9776c53c Fixed bug #79151
Make sure we also NULL out next/prev of the removed element on
pop/shift. This only matter is that element is still being referenced
by an iterator.
2020-01-23 14:20:26 +01:00
Christoph M. Becker
9be31a582a Fix #79154: mb_convert_encoding() can modify $from_encoding
We must not modify arrays passed by value.
2020-01-22 10:28:07 +01:00
Remi Collet
7e2bd95fa5 next will be 7.2.28 2020-01-22 09:17:00 +01:00
Christoph M. Becker
9eff906a02 Fix #79145: openssl memory leak
We must increase the refcount of `return_value` only if `cert` is a
resource; this is already done in `php_openssl_evp_from_zval()`,
though.
2020-01-21 16:17:25 +01:00
Deus Kane
3046e35718 Fix #79146: cscript can fail to run on some systems
In the buildconf and configure batch files, Windows' cscript utility was being
run without the /e:jscript flag. This works on systems that have not had the
default .js file association changed, but if .js has been re-associated to
(say) an IDE, the batch files fail with the error message:

Input Error: There is no script engine for file extension ".js".
2020-01-21 11:53:11 +01:00
Christoph M. Becker
b67fc51859 Update NEWS wrt. sec fixes 2020-01-21 11:31:14 +01:00
Stanislav Malyshev
5c90f8eb66 Update NEWS 2020-01-20 22:12:32 -08:00
Nikita Popov
07bda97e76 Fixed bug #79115 2020-01-17 11:37:35 +01:00
Nikita Popov
018251a7c4 Fixed bug #71876
This is a backport of fcdc0a6db0
to the PHP-7.3 branch. We need to make sure that OnUpdateString
is also called for a NULL value, otherwise the reset of the encoding
at the end of the request will not work.

I believe I already tried to land this before once, but it didn't
actually end up on the PHP-7.3 branch due to a push conflict that
I only noticed just now.
2020-01-17 09:47:31 +01:00
Christoph M. Becker
1752393bb4 Fix #79084: mysqlnd may fetch wrong column indexes with MYSQLI_BOTH
Column names can be numeric strings, so we have to make sure to insert
the column values with the appropriate numeric keys, instead of adding
them.
2020-01-13 13:21:45 +01:00
Christoph M. Becker
0dda4a844e Fix #79078: Hypothetical use-after-free in curl_multi_add_handle()
To avoid this, we have to verify the handlers already in
`curl_multi_add_handle()`, not only in `curl_multi_exec()`.
2020-01-08 18:29:10 +01:00
Christoph M. Becker
38c0a53b60 Bump version 2020-01-07 11:03:19 +01:00
Christoph M. Becker
06e78cad83 Revert "Extend CURLFile to support streams"
This reverts commit 17a9f1401a, because
this commit would break ABI, and also due to bug #79013.
We keep the commit for PHP 7.4+, though.
2020-01-06 15:31:49 +01:00
Christoph M. Becker
ae2150692a Fix #54298: Using empty additional_headers adding extraneous CRLF
If the header string is empty, we pass `NULL` to `php_mail()` to avoid
further checks on the string length.
2020-01-06 14:47:23 +01:00
Christoph M. Becker
4bec59f175 Fix #79068: gdTransformAffineCopy() changes interpolation method
We port
<9088591eae>.
2020-01-06 10:36:48 +01:00
Christoph M. Becker
2c5860517c Fix #79067: gdTransformAffineCopy() may use unitialized values
We port
<7a06c1669c>.
2020-01-06 09:35:13 +01:00
Christoph M. Becker
c05a069adf Fix #78808: [LMDB] MDB_MAP_FULL: Environment mapsize limit reached
We implement support for a fifth parameter, which allows to specify the
mapsize.  The parameter defaults to zero, in which case the compiled in
default mapsize (usually 1048576) will be used.  The mapsize should be
a multiple of the page size of the OS.
2020-01-03 18:49:12 +01:00
Christoph M. Becker
18172303f4 Fix #78538: shmop memory leak
If the descriptor's refcount drops to zero, we have to unmap the
respective file view, to avoid leaking memory.
2020-01-03 18:10:29 +01:00
Christoph M. Becker
b48f2625b5 Fix #79015: undefined-behavior in php_date.c
We check that the given microsecond fraction is in the valid range
[0, 1000000[, and otherwise mark it as invalid.  We also drop the
useless do loop; a plain block is sufficient here.
2020-01-03 14:31:03 +01:00
Christoph M. Becker
0cecf83b26 Fix #79040: Warning Opcode handlers are unusable due to ASLR
We must not use the same shared memory OPcache instance for different
SAPIs, since their memory layout is different.  To avoid this, we add
the SAPI name (truncated to at most 20 characters) to the names of the
memory base file, the mutex and the file mapping.
2019-12-30 15:12:58 +01:00
Christoph M. Becker
c47b18a222 Fix #79033: Curl timeout error with specific url and post
We must not set an empty mime structure as `CURLOPT_MIMEPOST`; instead
we set it to `NULL` if `CURLOPT_POSTFIELDS` has been set to an empty
array.
2019-12-28 10:47:03 +01:00
Xinchen Hui
27bb3289ac Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter).
We backport the fix PHP 7.3, since this branch is affected as well.

(cherry picked from commit b5e0043796)
(cherry picked from commit e36daa6927)
(cherry picked from commit 2704ee6844)
2019-12-25 12:33:30 +01:00
SATO Kentaro
37d11d123e Fix #78982: pdo_pgsql returns dead persistent connection
Call PQconsumeInput() before PQstatus() to update the status.
2019-12-20 12:05:17 +01:00
SATO Kentaro
7e39e6934d Fix #78980: pgsqlGetNotify() overlooks dead connection
pgsqlGetNotify() didn't check result of PQconsumeInput().
2019-12-20 11:44:07 +01:00
Sergei Turchanov
c62cd9a43a Fix #74170: locale information change after mime_content_type
Some functions in libmagic (distributed with fileinfo extension) perform this sequence of calls:
func() {
setlocale(LC_TYPE, "C")
.. do some work ..
setlocale(LC_TYPE, "")
}

It effectively resets LC_TYPE if it that was set before the function call.

To avoid manipulations with current locale at all, the problematic functions
were modified to use locale-independent functions.
2019-12-20 11:22:59 +01:00
SATO Kentaro
cbb0efaeeb Fix #78402: pcntl_signal() misleading error message
An error message can be misleading when a handler
passed to pcntl_signal() is not callable.
2019-12-20 11:02:20 +01:00
Dmitry Stogov
eb846939b1 Fixed bug #78999 (Cycle leak when using function result as temporary) 2019-12-19 23:11:08 +03:00
SATO Kentaro
3e35b08980 Fix #78983: pdo_pgsql config.w32 cannot find libpq-fe.h
When configured with a path specified.
2019-12-19 13:20:43 +01:00
Remi Collet
bacfae8baf fix release date 2019-12-18 14:17:31 +01:00
Remi Collet
864f5ef12f fix release date 2019-12-18 14:16:19 +01:00
Christoph M. Becker
3d50131ef7 Update/fix NEWS [ci skip] 2019-12-17 10:04:42 +01:00
Stanislav Malyshev
0e413241ec [ci skip] Update NEWS 2019-12-16 23:45:11 -08:00
Stanislav Malyshev
9705e631a4 [ci skip] Update NEWS 2019-12-16 23:41:04 -08:00
Christoph M. Becker
17a9f1401a Extend CURLFile to support streams
Due to former restrictions of the libcurl API, curl multipart/formdata
file uploads supported only proper files.  However, as of curl 7.56.0
the new `curl_mime_*()` API is available (and already supported by
PHP[1]), which allows us to support arbitrary *seekable* streams, which
is generally desirable, and particularly resolves issues with the
transparent Unicode and long part support on Windows (see bug #77711).

Note that older curl versions are still supported, but CURLFile is
still restricted to proper files in this case.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=a83b68ba56714bfa06737a61af795460caa4a105>

(cherry picked from commit c68dc6b5e3)
2019-12-09 10:30:00 +01:00
willson-chen
b5d2cbe027 Fix #78923: Artifacts when convoluting image with transparency
We have to properly initialize `pxl` before using it.

Fix ported from <https://github.com/libgd/libgd/pull/559>.
2019-12-07 12:06:33 +01:00
Christoph M. Becker
65bbc67063 Next is 7.3.14 2019-12-03 12:04:17 +01:00
Remi Collet
d2cfb63f02 next is 7.2.27 2019-12-03 11:25:37 +01:00
Christoph M. Becker
861fa60814 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78814: strip_tags allows / in tag name => whitelist bypass
2019-12-02 11:38:45 +01:00
Christoph M. Becker
600f1f898f Fix #78814: strip_tags allows / in tag name => whitelist bypass
When normalizing tags to check whether they are contained in the set
of allowable tags, we must not strip slashes, unless they come
immediately after the opening `<`, or immediately before the closing
`>`.
2019-12-02 11:37:25 +01:00
Christoph M. Becker
bb735c9e9e Fix #78296: is_file fails to detect file
If we're constructing extended-length paths (i.e. paths prefixed with
`\\?\`), we have to replace all forward slashes with backward slashes,
because the former are not supported by Windows for extended-length
paths.

The more efficient and likely cleaner alternative solution would be to
cater to this in `php_win32_ioutil_normalize_path_w()` by always
replacing forward slashes, but that might break existing code.  It
might be sensible to change that for `master`, though.
2019-12-02 11:29:10 +01:00
Christoph M. Becker
3d81c54879 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78833: Integer overflow in pack causes out-of-bound access
2019-12-02 11:19:15 +01:00
Christoph M. Becker
db420cb6a1 Fix #78833: Integer overflow in pack causes out-of-bound access
We check for potential signed integer overflow, and bail out
gracefully, in that case.
2019-12-02 11:18:19 +01:00
Christoph M. Becker
1979c5d16f Upgrade to Oniguruma 6.9.4
Oniguruma 6.9.4 fixes several CVEs.
2019-11-30 14:00:41 +01:00
Christoph M. Becker
fee38633d2 Fix #78840: imploding $GLOBALS crashes
We add support for IS_INDIRECT zvals to implode().
2019-11-27 09:32:16 +01:00
Christoph M. Becker
23c65a8173 Fix #77638: var_export'ing certain class instances segfaults
If objects return immutable property hash tables (typically,
`zend_empty_array`), we must not try to apply recursion protection on
those.
2019-11-25 15:54:11 +01:00
Dmitry Stogov
bb30fe9e2b Fixed bug #78868 (Calling __autoload() with incorrect EG(fake_scope) value) 2019-11-25 14:05:43 +03:00
Christoph M. Becker
e1da72bdf1 Fix #78853: preg_match() may return integer > 1
Commit 54ebebd[1] optimized the match loop, but for this case it has
been overlooked, that we must only loop if we're doing global matching.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=54ebebd686255c5f124af718c966edb392782d4a>
2019-11-22 19:26:26 +01:00
Christoph M. Becker
b4f501d5a4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
2019-11-21 10:01:05 +01:00
Christoph M. Becker
9b92c1d154 Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
Apparently, this has not been tested for a long time, and might be a
refactoring relict.  Anyhow, we have to pass the context to
`GIFNextPixel` as well.
2019-11-21 09:59:26 +01:00
Christoph M. Becker
3b46fbfc36 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
2019-11-18 12:47:53 +01:00
Christoph M. Becker
f6eac76b65 Update NEWS 2019-11-18 12:46:43 +01:00
Christoph M. Becker
39d04f15f8 Fix ASLR related invalid opline handler issues
Opcache stores `opline->handler`s in shared memory.  These pointers are
invalid, if the main PHP DLL is loaded at another base address due to
ASLR.  We therefore store the address of `execute_ex` in the mmap base
file, and check on startup whether it matches its current address.  If
not, we fall back on the file cache if enabled, and bail out otherwise.

This still does not address cases where the opline handler is located
inside of another DLL (e.g. for some profilers, debuggers), but there
seems to be no general solution for now.

(cherry picked from commit 8ba10b8fbc)
2019-11-15 09:46:58 +01:00
Stanislav Malyshev
2c9926f156 Fix bug #78804 - Segmentation fault in Locale::filterMatches 2019-11-11 22:32:35 -08:00
Nikita Popov
8d2a9d8859 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #78759
2019-11-07 11:16:24 +01:00
Nikita Popov
5fa6dcd972 Fixed bug #78759
Handle INDIRECT values in array.
2019-11-07 11:15:29 +01:00
Nikita Popov
6d4965febd Fixed bug #78787
Not the first time inheritance of shadow properties causes an issue,
thankfully this whole concept is gone in PHP 7.4.
2019-11-06 12:52:34 +01:00
Christoph M. Becker
4c9ba3e042 7.3.13 is next 2019-11-05 18:20:56 +01:00
Sara Golemon
d317e16e89
Bump for 7.2.26-dev 2019-11-05 10:57:29 -05:00
Nikita Popov
747cb46244 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #78775
2019-11-05 12:15:44 +01:00
Nikita Popov
4f984a2fdb Fixed bug #78775
Clear the OpenSSL error queue before performing SSL stream operations.
As we don't control all code that could possibly be using OpenSSL,
we can't rely on the error queue being empty.
2019-11-05 12:13:46 +01:00
Nikita Popov
33dd25d21c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #78689
2019-10-29 15:06:52 +01:00
Nikita Popov
f9895b4bf5 Fixed bug #78689 2019-10-29 15:06:16 +01:00
Christoph M. Becker
736cd93ef5 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78751: Serialising DatePeriod converts DateTimeImmutable
2019-10-28 13:08:34 +01:00
Christoph M. Becker
89c327f884 Fix #78751: Serialising DatePeriod converts DateTimeImmutable
When getting the properties of a DatePeriod instance we have to retain
the proper classes, and when restoring a DatePeriod instance we have to
cater to DateTimeImmutable instances as well.
2019-10-28 13:07:28 +01:00
Nikita Popov
b61b60d15b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #78752
2019-10-28 10:28:04 +01:00
Nikita Popov
16c4910876 Fix bug #78752
NULL out the execute_data before destroying it, otherwise GC may
trigger while the execute_data is partially destroyed, resulting
in double-frees.

The handling of call stack unfreezing is a bit awkward because it's
a ZEND_API function, so we can't change the signature.
2019-10-28 10:27:32 +01:00
Nikita Popov
74699533e5 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #78747
2019-10-25 12:50:12 +02:00
Nikita Popov
5249993814 Fixed bug #78747 2019-10-25 12:47:18 +02:00
Christoph M. Becker
36943dfff1 Update NEWS 2019-10-22 09:50:11 +02:00
Remi Collet
2213bd36fd add NEWS entry 2019-10-22 09:37:35 +02:00
Joe Watkins
1c9b62fbd4
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #78697: inaccurate error message
2019-10-21 09:23:26 +02:00
Fabien Villepinte
bea2ff88c9
Fix bug #78697: inaccurate error message 2019-10-21 09:22:09 +02:00
Christoph M. Becker
ce035dc4a0 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78694: Appending to a variant array causes segfault
2019-10-19 11:49:18 +02:00
Christoph M. Becker
45a7723267 Fix #78694: Appending to a variant array causes segfault
`write_dimension` object handlers have to be able to handle `NULL`
`offset`s; for now we simply throw an exception instead of following
the `NULL` pointer.
2019-10-19 11:47:00 +02:00
Christoph M. Becker
c7c7ab53ac Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #70153 \DateInterval incorrectly unserialized
2019-10-18 15:32:08 +02:00
m.yakunin
d2cde0bfd3 Fix #70153 \DateInterval incorrectly unserialized
Added a separate macro for reading 'days' property, so that bool(false)
is correctly converted to the proper internal representation.
2019-10-18 15:31:14 +02:00
Joe Watkins
22ac57b064
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix checksum calculation for opcache
2019-10-14 16:49:48 +02:00
Mitch Hagstrand
e2a6bf482f
Fix checksum calculation for opcache 2019-10-14 16:46:42 +02:00
Christoph M. Becker
7439d48bea Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78665: Multicasting may leak memory
2019-10-12 14:44:55 +02:00
Christoph M. Becker
900bdcbd03 Fix #78665: Multicasting may leak memory 2019-10-12 14:43:43 +02:00
Christoph M. Becker
bbd481c11d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78656: Parse errors classified as highest log-level
2019-10-09 17:28:50 +02:00
Erik Lundin
3164186d53 Fix #78656: Parse errors classified as highest log-level 2019-10-09 17:27:32 +02:00
Nikita Popov
6fd6ad8f53 Fixed bug #78658 2019-10-09 17:00:27 +02:00
Christoph M. Becker
d6fdc17f7f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78642: Wrong libiconv version displayed
2019-10-08 12:10:06 +02:00
Christoph M. Becker
195c2008e8 Fix #78642: Wrong libiconv version displayed
The high byte of `_libiconv_version` specifies the major version; the
low byte the minor version.
2019-10-08 12:09:11 +02:00
Christoph M. Becker
26f45cb4bb 7.3.12 is next 2019-10-08 12:04:25 +02:00
Remi Collet
05d6878b3b next is 7.2.25 2019-10-08 11:36:10 +02:00
Christoph M. Becker
11654fdfa6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78641: addGlob can modify given remove_path value
2019-10-08 09:48:59 +02:00
Christoph M. Becker
fd3118ffb0 Fix #78641: addGlob can modify given remove_path value
`remove_path` points to the given string, so we must not modify it.
Instead we use a duplicate, if we need the modification.

We may want to switch to `zend_string`s in master.
2019-10-08 09:45:05 +02:00
Christoph M. Becker
3322c78a88 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78623: Regression caused by "SP call yields additional empty result set"
2019-10-07 09:17:29 +02:00
Christoph M. Becker
114c03b9a6 Fix #78623: Regression caused by "SP call yields additional empty result set"
This reverts commit 41a4379cb4.
2019-10-07 09:15:51 +02:00
Christoph M. Becker
cf183a5e2c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78620: Out of memory error
2019-10-04 09:09:39 +02:00
Christoph M. Becker
abaf9a76dc Fix #78620: Out of memory error
The integer addition in `ZEND_MM_ALIGNED_SIZE_EX` can overflow, what we
have to catch early.
2019-10-04 09:08:01 +02:00
Joe Watkins
f45eb353d1
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  fix #78624: session_gc return value for user defined session handlers
2019-10-04 06:12:29 +02:00
Brent Shaffer
a6d219630c
fix #78624: session_gc return value for user defined session handlers 2019-10-04 06:12:02 +02:00
Joe Watkins
f4d078b1c7
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #76809 (SSL settings aren't respected when persistent connection is reused)
2019-10-03 06:57:05 +02:00
Fábio Souto
9a2b42a5c1
Fix bug #76809 (SSL settings aren't respected when persistent connection is reused) 2019-10-03 06:56:21 +02:00
Joe Watkins
5b1bb23edf
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #76859 stream_get_line skips data if used with data-generating filter
2019-10-03 06:51:10 +02:00
Konstantin Kopachev
05560b67bc
Fix #76859 stream_get_line skips data if used with data-generating filter
stream_get-line repeatedly calls php_stream_fill_read_buffer until
enough data is accumulated in buffer. However, when stream contains
filters attached to it, then each call to fill buffer essentially
resets buffer read/write pointers and new data is written over old.
This causes stream_get_line to skip parts of data from stream
This patch fixes such behavior, so fill buffer call will append.
2019-10-03 06:50:43 +02:00
Christoph M. Becker
d295e1dce2 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Revert "Fix #78620: Out of memory error"
2019-10-02 19:02:28 +02:00
Christoph M. Becker
f2fb37a772 Revert "Fix #78620: Out of memory error"
This reverts commit 8ce04df7e0.

Cf. <https://github.com/php/php-src/pull/4766#discussion_r330658679>.
2019-10-02 19:01:35 +02:00
Christoph M. Becker
752a34fb2c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78620: Out of memory error
2019-10-02 18:20:09 +02:00
Christoph M. Becker
8ce04df7e0 Fix #78620: Out of memory error
If the integer addition in `ZEND_MM_ALIGNED_SIZE_EX` overflows, the
macro evaluates to `0`, what we should catch early.
2019-10-02 18:18:52 +02:00
Nikita Popov
0805e132b0 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-30 15:06:32 +02:00
Nikita Popov
6fcde56b03 Fixed bug #78612 2019-09-30 15:06:07 +02:00
Christoph M. Becker
2046b3ce4f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78609: mb_check_encoding() no longer supports stringable objects
2019-09-30 13:04:54 +02:00
Sergei Turchanov
e546d721e8 Fix #78413: php-fpm request_terminate_timeout does not take effect after fastcgi_finish_request
To retain legacy behavior I decided to add an option to control request
termination logic. If request_terminate_timeout_track_finished is set,
then request will be tracked for time limits even after
fastcgi_finish_request was called.

This patch depends on the fix provided in BUG 78469 (otherwise php-fpm
workers listening on named pipes on Windows will be erroneously terminated)
(PR #4636)
2019-09-30 12:54:09 +02:00
Christoph M. Becker
45db6fa567 Fix #78609: mb_check_encoding() no longer supports stringable objects
We apply type juggling for other types than array.
2019-09-30 12:42:04 +02:00