Christoph M. Becker [Tue, 23 Mar 2021 15:13:57 +0000 (16:13 +0100)]
Fix #73533: Invalid memory access in php_libxml_xmlCheckUTF8
A string passed to `php_libxml_xmlCheckUTF8()` may be longer than
1<<31-1 bytes, so we're better using a `size_t`.
Closes GH-6802.
Christoph M. Becker [Mon, 22 Mar 2021 12:21:07 +0000 (13:21 +0100)]
Properly initialize PS(mod) on RINIT
We need to do that in case a user handler has been set. However, we
can't do that in `php_rinit_session_globals()` since that function is
called by PHP function `session_destroy()` too, but in that case we
don't want to reset PS(mod).
Closes GH-6795.
Christoph M. Becker [Mon, 22 Mar 2021 21:14:01 +0000 (22:14 +0100)]
Fix #80889: amendment
`session_set_save_handler()` may be called with callables instead of an
object; we need to cater to that as well.
We also extract a set_user_save_handler_ini() function to avoid code
duplication.
Closes GH-6796.
Jakub Zelenka [Fri, 27 Nov 2020 17:29:23 +0000 (17:29 +0000)]
Use ServerClientTestCase in a test for default_socket_timeout=-1
Jakub Zelenka [Sun, 21 Mar 2021 18:58:57 +0000 (18:58 +0000)]
Fix NEWS entry position for the latest FPM fix
Jakub Zelenka [Sun, 28 Feb 2021 21:08:17 +0000 (21:08 +0000)]
Fix bug #80024: Duplication of info about inherited socket after pool removing
Christoph M. Becker [Fri, 19 Mar 2021 13:47:49 +0000 (14:47 +0100)]
Fix #80889: Cannot set save handler when save_handler is invalid
There is no need to require a (valid) save_handler to be set, when a
user handler is supposed to be set. We just have to make sure, that
no user handler is already set in this case.
Closes GH-6788.
Christoph M. Becker [Thu, 25 Feb 2021 13:38:42 +0000 (14:38 +0100)]
Fix #80783: PDO ODBC truncates BLOB records at every 256th byte
It is not guaranteed, that the driver inserts only a single NUL byte at
the end of the buffer. Apparently, there is no way to find out the
actual data length in the buffer after calling `SQLGetData()`, so we
adjust after the next `SQLGetData()` call.
We also prevent PDO::ODBC_ATTR_ASSUME_UTF8 from fetching garbage, by
fetching all chunks with the same C type.
Closes GH-6716.
Nikita Popov [Thu, 18 Mar 2021 09:48:43 +0000 (10:48 +0100)]
Fix locale switch back to C in pcre
The compile context is shared between patterns, so we need to set
the character tables unconditionally in case we switched from
a non-C locale to the C locale.
Christoph M. Becker [Mon, 15 Mar 2021 09:26:50 +0000 (10:26 +0100)]
Fix #66783: UAF when appending DOMDocument to element
According to the DOM standard, elements may only contain element, text,
processing instruction and comment nodes[1]. It is also specified that
a HierarchyRequestError should be thrown if a document is to be
inserted[2]. We follow that standard, and prevent the use-after-free
this way.
[1] <https://dom.spec.whatwg.org/#node-trees>
[2] <https://dom.spec.whatwg.org/#mutation-algorithms>
Closes GH-6765.
Derick Rethans [Tue, 16 Mar 2021 09:41:21 +0000 (09:41 +0000)]
Fix build version too
Derick Rethans [Tue, 16 Mar 2021 09:40:05 +0000 (09:40 +0000)]
NEWS for 7.4.18
Derick Rethans [Tue, 16 Mar 2021 09:33:33 +0000 (09:33 +0000)]
Prepare for 7.4.17RC1
Christoph M. Becker [Mon, 1 Mar 2021 17:14:26 +0000 (18:14 +0100)]
Fix #80817: dba_popen() may cause segfault during RSHUTDOWN
We need to close persistent streams with the proper flag.
Dharman [Mon, 15 Mar 2021 12:21:44 +0000 (12:21 +0000)]
Fix bug #80866
Closes GH-6774.
Dharman [Fri, 5 Mar 2021 21:45:27 +0000 (21:45 +0000)]
Fix bug #80837
The error needs to be reported on the statement, not the connection.
Nikita Popov [Mon, 15 Mar 2021 11:11:51 +0000 (12:11 +0100)]
Update ubuntu on i386 job
There is a failure with apt on PHP-7.4 that's not present on
PHP-8.0/master. Switching to a newer ubuntu version on PHP-7.4
avoids the issue.
Nikita Popov [Thu, 18 Jun 2020 13:08:24 +0000 (15:08 +0200)]
Downgrade security level in tests using TLS < 1.2
A few additional tests have been added on master that require
lower security level.
(cherry picked from commit
c2a6395dcbab20549702e56006f7cd389cefebcd)
Christoph M. Becker [Wed, 3 Mar 2021 18:23:39 +0000 (19:23 +0100)]
Fix #51903: simplexml_load_file() doesn't use HTTP headers
The `encoding` attribute of the XML declaration is optional; it is good
practice to use external encoding information where available if it is
missing. Thus, we check for `charset` info of `Content-Type` headers,
and see whether the encoding is supported.
We cater to trailing parameters and quoted-strings, but not to escaped
backslashes and quotes in quoted-strings, since no known character
encoding contains these anyway.
Co-authored-by: Michael Wallner <mike@php.net>
Closes GH-6747.
manuel [Fri, 5 Mar 2021 23:59:45 +0000 (00:59 +0100)]
Fix #80838: HTTP wrapper waits for HTTP 1 response after HTTP 101
Don't wait for further responses after a HTTP 101 (Switching Protocols) response
Closes GH-6730.
George Wang [Fri, 5 Mar 2021 15:57:46 +0000 (10:57 -0500)]
Merge branch 'PHP-7.4' of git.php.net:php-src into PHP-7.4
George Wang [Fri, 5 Mar 2021 15:46:12 +0000 (10:46 -0500)]
LiteSpeed SAPI v7.9: Process manager keeps forked child process alive for longer time based on load. Reduces PM overhead for busy setup.
Christoph M. Becker [Tue, 2 Mar 2021 11:19:43 +0000 (12:19 +0100)]
Print error code if CreateMutex() fails
This issue came up recently in a bug report[1]; without the error code,
users can barely guess why the function failed.
[1] <https://bugs.php.net/80812>
Closes GH-6745.
Christoph M. Becker [Tue, 23 Feb 2021 14:32:54 +0000 (15:32 +0100)]
Fix #78719: http wrapper silently ignores long Location headers
When opening HTTP streams, and reading the headers, we currently
discard header lines longer than `HTTP_HEADER_BLOCK_SIZE` (1024 bytes).
While this is not generally forbidden by RFC 7230, section 3.2.5, it
is not generally allowed either, since that may change the "message
framing or response semantics".
We thus fix this by allowing arbitrarily long header lines.
Closes GH-6720.
Christoph M. Becker [Mon, 1 Mar 2021 15:18:40 +0000 (16:18 +0100)]
Fix #80751: Comma in recipient name breaks email delivery
So far, `SendText()` simply separates potential email address lists at
any comma, disregarding that commas inside a quoted-string do not
delimit addresses. We fix that by introducing an own variant of
`strtok_r()` which caters to quoted-strings.
We also make `FormatEmailAddress()` aware of quoted strings.
We do not cater to email address comments, and potentially other quirks
of RFC 5322 email addresses, but catering to quoted-strings is supposed
to solve almost all practical use cases.
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
Closes GH-6735.
Nikita Popov [Mon, 1 Mar 2021 15:20:31 +0000 (16:20 +0100)]
Always remove HT iterators, even for uninit HT
Fixes oss-fuzz #31423.
Nikita Popov [Fri, 11 Sep 2020 20:36:41 +0000 (22:36 +0200)]
Fixed bug #80805
Handle missing result_var in binary_op_result_type.
(cherry picked from commit
8446e2827585c37d0739f8d44fa8d359cbbb6551)
Felipe Pena [Thu, 25 Feb 2021 20:53:14 +0000 (20:53 +0000)]
Fix memleak on ReflectionFunction and ReflectionGenerator classes when calling __construct after instantiation
Remi Collet [Thu, 25 Feb 2021 12:52:35 +0000 (13:52 +0100)]
skip test with openssl < 1.1.0
The test fails, but without any crash
(this test is designed to catch a crash)
Dylan K. Taylor [Tue, 23 Feb 2021 21:34:51 +0000 (22:34 +0100)]
Capture Microsoft-defined HRESULT exit codes exit codes
The lack of such a check leads to false-passes of tests on Windows
which expect no output, but produce a segfault or similar issue. I
discovered this a while ago due to bad tests in an extension I maintain.
Closes GH-6722.
Daniel Black [Thu, 25 Feb 2021 02:09:08 +0000 (13:09 +1100)]
mysqlnd pam fix test error message
Closes GH-6727.
Nikita Popov [Wed, 24 Feb 2021 20:30:20 +0000 (21:30 +0100)]
Fix potential file collision in dom tests
Felipe Pena [Wed, 24 Feb 2021 18:17:27 +0000 (18:17 +0000)]
Fix bug #80757 (Exit code is 0 when could not open file)
Felipe Pena [Wed, 24 Feb 2021 18:40:32 +0000 (18:40 +0000)]
Update NEWS
Christoph M. Becker [Tue, 23 Feb 2021 12:14:42 +0000 (13:14 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
run-tests: fixed exit code not being set on BORKED tests
Dylan K. Taylor [Mon, 22 Feb 2021 23:56:11 +0000 (23:56 +0000)]
run-tests: fixed exit code not being set on BORKED tests
When no test paths are specified this shows up when 'make test' is used on a PECL extension without specifying tests to run (or in php-src too, I guess...)
Closes GH-6717.
Christoph M. Becker [Tue, 23 Feb 2021 11:09:06 +0000 (12:09 +0100)]
Update php_version.h to proper version number
Christoph M. Becker [Tue, 16 Feb 2021 18:36:37 +0000 (19:36 +0100)]
Fix #75776: Flushing streams with compression filter is broken
First, the `bzip2.compress` filter has the same issue as `zlib.deflate`
so we port the respective fix[1] to ext/bz2.
Second, there is still an issue, if a stream with an attached
compression filter is flushed before it is closed, without any writes
in between. In that case, the compression is never finalized. We fix
this by enforcing a `_php_stream_flush()` with the `closing` flag set
in `_php_stream_free()`, whenever a write filter is attached. This
call is superfluous for most write filters, but does not hurt, even
when it is unnecessary.
[1] <http://git.php.net/?p=php-src.git;a=commit;h=
20e75329f2adb11dd231852c061926d0e4080929>
Closes GH-6703.
Christoph M. Becker [Mon, 22 Feb 2021 11:24:15 +0000 (12:24 +0100)]
Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
There is no good reason not to show the credits in text based SAPIs,
except for brevity. Thus, we suppress the credits from `php -i`.
Closes GH-6710.
Christoph M. Becker [Fri, 19 Feb 2021 12:14:26 +0000 (13:14 +0100)]
Fix #80774: session_name() problem with backslash
Since we do no longer URL decode cookie names[1], we must not URL
encode the session name. We need to prevent broken Set-Cookie headers,
by rejecting names which contain invalid characters.
[1] <http://git.php.net/?p=php-src.git;a=commit;h=
6559fe912661ca5ce5f0eeeb591d928451428ed0>
Closes GH-6711.
Nikita Popov [Mon, 22 Feb 2021 08:33:23 +0000 (09:33 +0100)]
Fixed bug #80781
zend_find_array_dim_slow() may throw, make sure to handle this.
This backports the code we already use for this on PHP-8.0,
and also backports an exception check that makes this easier to
catch.
Christoph M. Becker [Wed, 17 Feb 2021 13:05:28 +0000 (14:05 +0100)]
Fix #80763: msgfmt_format() does not accept DateTime references
`intl_zval_to_millis()` needs to cater to references.
Closes GH-6707.
Nikita Popov [Tue, 16 Feb 2021 14:26:31 +0000 (15:26 +0100)]
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.
Derick Rethans [Tue, 16 Feb 2021 11:31:34 +0000 (11:31 +0000)]
Fixed dates
Derick Rethans [Tue, 16 Feb 2021 11:26:47 +0000 (11:26 +0000)]
PHP-7.4 is now 7.4.17-dev
Nikita Popov [Mon, 15 Feb 2021 14:54:49 +0000 (15:54 +0100)]
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:
https://github.com/openssl/openssl/blob/
22040fb790c854cefb04bed98ed38ea6357daf83/apps/req.c#L515-L517
Closes GH-6699.
Nikita Popov [Mon, 15 Feb 2021 14:33:42 +0000 (15:33 +0100)]
Fixed bug #80747
If RSA key generation fails, actually report that failure.
Nikita Popov [Mon, 15 Feb 2021 13:52:38 +0000 (14:52 +0100)]
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.
Daniel Black [Fri, 5 Feb 2021 05:54:08 +0000 (16:54 +1100)]
Fix #78680: mysqlnd pam plugin missing terminating null
The PAM service requires the terminating null to be part
of the communication.
Tested with MariaDB-10.4(pam) and Percona Server 5.7.32(auth_pam_compat).
Also changed MySQL Enterprise test to the server side plugin, authentication_pam
as opposed to the client plugin mysql_clear_password.
Add additional check for pamtest user and pam service file as
all are required for the test.
More importantly, test result should actually succeed.
Thanks Geoff Montee for bug report.
Closes GH-78680.
Nikita Popov [Mon, 15 Feb 2021 09:36:48 +0000 (10:36 +0100)]
Fix leak when breaking out of FilesystemIterator
We need to always destroy current, not just when iter.data is not
set.
Take this opportunity to clean up the iterator destructor code a
bit, to remove redundant checks and incorrect comments.
Nikita Popov [Thu, 11 Feb 2021 15:12:06 +0000 (16:12 +0100)]
Fixed bug #80719
Christoph M. Becker [Mon, 8 Feb 2021 22:11:37 +0000 (23:11 +0100)]
Avoid C4090 level 1 warning
This breaks the build for PHP 8 by default.
Christoph M. Becker [Fri, 5 Feb 2021 11:53:25 +0000 (12:53 +0100)]
Fix locale dependent parsing of PostgreSQL version number
Version numbers are not supposed to be localized, so we must not apply
locale dependent parsing with `atof()`.
Using `php_version_compare()` might even be better.
Closes GH-6668.
Christoph M. Becker [Thu, 4 Feb 2021 16:43:53 +0000 (17:43 +0100)]
Fix #80706: mail(): Headers after Bcc headers may be ignored
We need to handle the case where a CRLF after a Bcc header is not the
beginning of a folding marker, because in that case the Bcc header was
not the last "thing".
Closes GH-6666.
Christoph M. Becker [Fri, 5 Feb 2021 13:53:19 +0000 (14:53 +0100)]
Use ST_Y() instead of the deprecated/removed Y() in test
Christoph M. Becker [Thu, 4 Feb 2021 13:43:17 +0000 (14:43 +0100)]
Fix #74779: x() and y() truncating floats to integers
We must not use the locale dependent `atof()`, but instead use the
(hopefully) locale independent `zend_strtod()`, when converting string
representations of floating point numbers which are sent by the server.
Closes GH-6665.
Nikita Popov [Mon, 7 Dec 2020 11:57:30 +0000 (12:57 +0100)]
Try SIGTERM before SIGKILL in opcache restart
SIGTERM is subject to HANDLE_BLOCK_INTERRUPTIONS(), which will
allow code to exit critical sections before it gets terminated.
Closes GH-6493.
Christoph M. Becker [Wed, 3 Feb 2021 11:43:15 +0000 (12:43 +0100)]
[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix newly introduced compiler warning
Nikita Popov [Mon, 1 Feb 2021 08:46:17 +0000 (09:46 +0100)]
Fix newly introduced compiler warning
(cherry picked from commit
ab8177de2c89672e63a7a1ccef4df8f7bf34fbd2)
Christoph M. Becker [Tue, 26 Jan 2021 16:46:32 +0000 (17:46 +0100)]
Fix #53467: Phar cannot compress large archives
When Phars are flushed, a new temporary file is created for each entry
which should be compressed, and the `compressed_filesize` is retrieved.
Afterwards, the Phar manifest is written, and only after that the files
are copied to the actual Phar. So for each such entry there is an open
temp file, what easily exceeds the limit.
Therefore, we use a single temporary file for all entries, and store
the start offset in the otherwise unused `header_offset` member. We
ensure that the `cfp` members are properly set to NULL even if flushing
fails, to avoid use after free scenarios.
This solution is based on a suggestion by @lserni[1].
Closes GH-6643.
[1] <https://github.com/box-project/box2/issues/80#issuecomment-
77147371>
Christoph M. Becker [Tue, 2 Feb 2021 16:03:05 +0000 (17:03 +0100)]
[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
7.3.28 is next
Christoph M. Becker [Tue, 2 Feb 2021 16:01:55 +0000 (17:01 +0100)]
7.3.28 is next
Peter Kokot [Sun, 24 Jan 2021 11:23:20 +0000 (12:23 +0100)]
Update year to 2021
Closes GH-6636.
Nikita Popov [Tue, 2 Feb 2021 09:31:16 +0000 (10:31 +0100)]
Add missing derefs in CurlFile
As pointed out on GH-6456.
Nikita Popov [Tue, 2 Feb 2021 09:05:35 +0000 (10:05 +0100)]
Fix persistent leak on load_wsdl_ex failure
Move the load_wsdl_ex call into the zend_try that destroys the
docs hash table. The wsdl will be inserted into docs early on,
and will thus be released on subsequent bailout.
Christoph M. Becker [Mon, 1 Feb 2021 12:42:43 +0000 (13:42 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Revert "Updated to version 2021.1 (2021a)"
Christoph M. Becker [Mon, 1 Feb 2021 12:41:32 +0000 (13:41 +0100)]
Revert "Updated to version 2021.1 (2021a)"
This reverts commit
491488d21707062fa8e9b9187db3585fb0d347da, since
PHP-7.3 is in security mode, and this does not look security related.
Christoph M. Becker [Thu, 28 Jan 2021 16:00:16 +0000 (17:00 +0100)]
Fix #80654: file_get_contents() maxlen fails above (2**31)-1 bytes
We remove the arbitrary restriction to `INT_MAX`; it is superfluous on
32bit systems where `ZEND_LONG_MAX == INT_MAX` anyway, and not useful
on 64bit systems, where larger files should be readable, if the
`memory_limit` is large enough.
Closes GH-6648.
Nikita Popov [Thu, 28 Jan 2021 09:24:48 +0000 (10:24 +0100)]
Fix Laravel build on community job
Now requires PHP 7.4, so use php7.4 to run composer everywhere.
Nikita Popov [Mon, 1 Feb 2021 08:46:17 +0000 (09:46 +0100)]
Fix build
Stanislav Malyshev [Mon, 1 Feb 2021 05:42:41 +0000 (21:42 -0800)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix bug #80672 - Null Dereference in SoapClient
Stanislav Malyshev [Mon, 1 Feb 2021 05:15:23 +0000 (21:15 -0800)]
Fix bug #80672 - Null Dereference in SoapClient
Remi Collet [Thu, 28 Jan 2021 15:25:35 +0000 (16:25 +0100)]
NEWS
Remi Collet [Thu, 28 Jan 2021 15:24:39 +0000 (16:24 +0100)]
Fix #80682 opcache doesn't honour pcre.jit option
Stanislav Malyshev [Wed, 27 Jan 2021 08:15:13 +0000 (00:15 -0800)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Rm unneeded function
Stanislav Malyshev [Wed, 27 Jan 2021 08:13:43 +0000 (00:13 -0800)]
Rm unneeded function
Stanislav Malyshev [Wed, 27 Jan 2021 06:55:10 +0000 (22:55 -0800)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Alternative fix for bug 77423
Christoph M. Becker [Tue, 19 Jan 2021 10:23:25 +0000 (11:23 +0100)]
Alternative fix for bug 77423
That bug report originally was about `parse_url()` misbehaving, but the
security aspect was actually only regarding `FILTER_VALIDATE_URL`.
Since the changes to `parse_url_ex()` apparently affect userland code
which is relying on the sloppy URL parsing[1], this alternative
restores the old parsing behavior, but ensures that the userinfo is
checked for correctness for `FILTER_VALIDATE_URL`.
[1] <https://github.com/php/php-src/commit/
5174de7cd33c3d4fa591c9c93859ff9989b07e8c#commitcomment-
45967652>
Christoph M. Becker [Tue, 26 Jan 2021 15:50:04 +0000 (16:50 +0100)]
Fix #70091: Phar does not mark UTF-8 filenames in ZIP archives
The default encoding of filenames in a ZIP archive is IBM Code Page
437. Phar, however, only supports UTF-8 filenames. Therefore we have
to mark filenames as being stored in UTF-8 by setting the general
purpose bit 11 (the language encoding flag).
The effect of not setting this bit for non ASCII filenames can be seen
in popular tools like 7-Zip and UnZip, but not when extracting the
archives via ext/phar (which is agnostic to the filename encoding), or
via ext/zip (which guesses the encoding). Thus we add a somewhat
brittle low-level test case.
Closes GH-6630.
Christoph M. Becker [Tue, 26 Jan 2021 18:07:57 +0000 (19:07 +0100)]
Update version
That appears to have been forgotten for a while.
Christoph M. Becker [Mon, 25 Jan 2021 16:12:48 +0000 (17:12 +0100)]
Fix #75850: Unclear error message wrt. __halt_compiler() w/o semicolon
We add the failure reason to the error message.
Closes GH-6638.
Derick Rethans [Mon, 25 Jan 2021 10:44:05 +0000 (10:44 +0000)]
Updated to version 2021.1 (2021a)
Derick Rethans [Mon, 25 Jan 2021 10:44:05 +0000 (10:44 +0000)]
Empty merge
Derick Rethans [Mon, 25 Jan 2021 10:44:04 +0000 (10:44 +0000)]
Updated to version 2021.1 (2021a)
Christoph M. Becker [Thu, 21 Jan 2021 16:16:54 +0000 (17:16 +0100)]
Add missing SKIPIF clause for recently introduced test case
Christoph M. Becker [Wed, 20 Jan 2021 14:24:47 +0000 (15:24 +0100)]
Fix #80648: Fix for bug 79296 should be based on runtime version
Instead of checking for actually affected libzip versions, we now always
`ZIP_TRUNCATE` empty files unless `ZIP_RDONLY` is set.
Closes GH-6625.
Christoph M. Becker [Wed, 20 Jan 2021 09:59:37 +0000 (10:59 +0100)]
Add missing SKIPIF clauses to new test cases
Derick Rethans [Tue, 19 Jan 2021 14:58:38 +0000 (14:58 +0000)]
Update NEWS and version
Derick Rethans [Tue, 19 Jan 2021 14:44:32 +0000 (14:44 +0000)]
Update NEWS for PHP 7.4.15RC1
sj-i [Sun, 20 Dec 2020 06:57:54 +0000 (15:57 +0900)]
Fixed bug #42560
Check open_basedir after the fallback to the system's temporary
directory in tempnam().
In order to preserve the current behavior of upload_tmp_dir
(do not check explicitly specified dir, but check fallback),
new flags are added to check open_basedir for explicit dir
and for fallback.
Closes GH-6526.
Christoph M. Becker [Fri, 18 Dec 2020 17:05:52 +0000 (18:05 +0100)]
Fix #69279: Compressed ZIP Phar extractTo() creates garbage files
When extracting compressed files from an uncompressed Phar, we must not
use the direct file pointer, but rather get an uncompressed file
pointer.
We also add a test to show that deflated and stored entries are
properly extracted.
This also fixes #79912, which appears to be a duplicate of #69279.
Co-authored-by: Anna Filina <afilina@gmail.com>
Closes GH-6599.
Christoph M. Becker [Fri, 15 Jan 2021 13:01:40 +0000 (14:01 +0100)]
Fix #80595: Resetting POSTFIELDS to empty array breaks request
This is mainly to work around https://github.com/curl/curl/issues/6455,
but not building the mime structure for empty hashtables is a general
performance optimization, so we do not restrict it to affected cURL
versions (7.56.0 to 7.75.0).
The minor change to bug79033.phpt is unexpected, but should not matter
in practice.
Closes GH-6606.
Christoph M. Becker [Mon, 11 Jan 2021 12:08:29 +0000 (13:08 +0100)]
Revert "Fix #76813: Access violation near NULL on source operand"
This reverts commit
5e15c9c41f8318a8392c2e2c78544f218736549c, since
re2c default rules are only available as of re2c 0.13.7.
Christoph M. Becker [Wed, 6 Jan 2021 17:56:02 +0000 (18:56 +0100)]
Avoid modifying the return value of readline_completion_function()
The internal function `_readline_command_generator()` modifies the
internal array pointer of `readline_completion_function()`'s return
value. We therefore separate the array, what also avoids failing
assertions regarding the array refcount.
Closes GH-6582.
Christoph M. Becker [Tue, 5 Jan 2021 14:52:38 +0000 (15:52 +0100)]
Fix #77565: Incorrect locator detection in ZIP-based phars
We must not assume that the first end of central dir signature in a ZIP
archive actually designates the end of central directory record, since
the data in the archive may contain arbitrary byte patterns. Thus, we
better search from the end of the data, what is also slightly more
efficient.
There is, however, no way to detect the end of central directory
signature by searching from the end of the ZIP archive with absolute
certainty, since the signature could be part of the trailing comment.
To mitigate, we check that the comment length fits to the found
position, but that might still not be the correct position in rare
cases.
Closes GH-6507.
Christoph M. Becker [Mon, 4 Jan 2021 16:08:06 +0000 (17:08 +0100)]
Fix memory leak in Phar::webPhar() on Windows
Closes GH-6574.
Dylan K. Taylor [Mon, 4 Jan 2021 23:13:00 +0000 (23:13 +0000)]
gdbinit: use ____print_str to print htable keys
I noticed this problem while dumping the contents of EG(function_table),
where keys for closures start with a null byte. printf interprets this
as a zero-length string and emits nothing. This allows the key to be
rendered properly in readable form.
Closes GH-6577.
Nikita Popov [Mon, 4 Jan 2021 09:52:37 +0000 (10:52 +0100)]
Disable non-cron travis jobs
This was already done for PHP-8.0 and master, do it for PHP-7.4
as well.
Stanislav Malyshev [Mon, 4 Jan 2021 09:46:32 +0000 (01:46 -0800)]
[ci skip] Update NEWS
Stanislav Malyshev [Mon, 4 Jan 2021 09:46:11 +0000 (01:46 -0800)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
[ci skip] Fix order