]> granicus.if.org Git - php/log
php
3 years agoPrepare for 7.4.17RC1
Derick Rethans [Tue, 16 Mar 2021 09:33:33 +0000 (09:33 +0000)]
Prepare for 7.4.17RC1

3 years agoFix #80817: dba_popen() may cause segfault during RSHUTDOWN
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.

3 years agoFix bug #80866
Dharman [Mon, 15 Mar 2021 12:21:44 +0000 (12:21 +0000)]
Fix bug #80866

Closes GH-6774.

3 years agoFix bug #80837
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.

3 years agoUpdate ubuntu on i386 job
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.

3 years agoDowngrade security level in tests using TLS < 1.2
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)

3 years agoFix #51903: simplexml_load_file() doesn't use HTTP headers
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.

3 years agoFix #80838: HTTP wrapper waits for HTTP 1 response after HTTP 101
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.

3 years agoMerge branch 'PHP-7.4' of git.php.net:php-src into PHP-7.4
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

3 years agoLiteSpeed SAPI v7.9: Process manager keeps forked child process alive for longer...
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.

3 years agoPrint error code if CreateMutex() fails
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.

3 years agoFix #78719: http wrapper silently ignores long Location headers
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.

3 years agoFix #80751: Comma in recipient name breaks email delivery
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.

3 years agoAlways remove HT iterators, even for uninit HT
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.

3 years agoFixed bug #80805
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)

3 years agoFix memleak on ReflectionFunction and ReflectionGenerator classes when calling __cons...
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

3 years agoskip test with openssl < 1.1.0
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)

3 years agoCapture Microsoft-defined HRESULT exit codes exit codes
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.

3 years agomysqlnd pam fix test error message
Daniel Black [Thu, 25 Feb 2021 02:09:08 +0000 (13:09 +1100)]
mysqlnd pam fix test error message

Closes GH-6727.

3 years agoFix potential file collision in dom tests
Nikita Popov [Wed, 24 Feb 2021 20:30:20 +0000 (21:30 +0100)]
Fix potential file collision in dom tests

3 years agoFix bug #80757 (Exit code is 0 when could not open file)
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)

3 years agoUpdate NEWS
Felipe Pena [Wed, 24 Feb 2021 18:40:32 +0000 (18:40 +0000)]
Update NEWS

3 years agoMerge branch 'PHP-7.3' into PHP-7.4
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

3 years agorun-tests: fixed exit code not being set on BORKED tests PHP-7.3
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.

3 years agoUpdate php_version.h to proper version number
Christoph M. Becker [Tue, 23 Feb 2021 11:09:06 +0000 (12:09 +0100)]
Update php_version.h to proper version number

3 years agoFix #75776: Flushing streams with compression filter is broken
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.

3 years agoFix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
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.

3 years agoFix #80774: session_name() problem with backslash
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.

3 years agoFixed bug #80781
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.

3 years agoFix #80763: msgfmt_format() does not accept DateTime references
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.

3 years agoHandle incomplete result set metadata more gracefully
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.

3 years agoFixed dates
Derick Rethans [Tue, 16 Feb 2021 11:31:34 +0000 (11:31 +0000)]
Fixed dates

3 years agoPHP-7.4 is now 7.4.17-dev
Derick Rethans [Tue, 16 Feb 2021 11:26:47 +0000 (11:26 +0000)]
PHP-7.4 is now 7.4.17-dev

3 years agoSuppress OpenSSL error on missing optional config
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.

3 years agoFixed bug #80747
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.

3 years agoFix symtable cache being used while cleaning symtable
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.

3 years agoFix #78680: mysqlnd pam plugin missing terminating null
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.

3 years agoFix leak when breaking out of FilesystemIterator
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.

3 years agoFixed bug #80719
Nikita Popov [Thu, 11 Feb 2021 15:12:06 +0000 (16:12 +0100)]
Fixed bug #80719

3 years agoAvoid C4090 level 1 warning
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.

3 years agoFix locale dependent parsing of PostgreSQL version number
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.

3 years agoFix #80706: mail(): Headers after Bcc headers may be ignored
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.

3 years agoUse ST_Y() instead of the deprecated/removed Y() in test
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

3 years agoFix #74779: x() and y() truncating floats to integers
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.

3 years agoTry SIGTERM before SIGKILL in opcache restart
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.

3 years ago[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
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

3 years agoFix 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)

3 years agoFix #53467: Phar cannot compress large archives
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>

3 years ago[ci skip] Merge branch 'PHP-7.3' into PHP-7.4
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

3 years ago7.3.28 is next
Christoph M. Becker [Tue, 2 Feb 2021 16:01:55 +0000 (17:01 +0100)]
7.3.28 is next

3 years agoUpdate year to 2021
Peter Kokot [Sun, 24 Jan 2021 11:23:20 +0000 (12:23 +0100)]
Update year to 2021

Closes GH-6636.

3 years agoAdd missing derefs in CurlFile
Nikita Popov [Tue, 2 Feb 2021 09:31:16 +0000 (10:31 +0100)]
Add missing derefs in CurlFile

As pointed out on GH-6456.

3 years agoFix persistent leak on load_wsdl_ex failure
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.

3 years agoMerge branch 'PHP-7.3' into PHP-7.4
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)"

3 years agoRevert "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.

3 years agoFix #80654: file_get_contents() maxlen fails above (2**31)-1 bytes
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.

3 years agoFix Laravel build on community job
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.

3 years agoFix build
Nikita Popov [Mon, 1 Feb 2021 08:46:17 +0000 (09:46 +0100)]
Fix build

3 years agoMerge branch 'PHP-7.3' into PHP-7.4
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

3 years agoFix 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

3 years agoNEWS
Remi Collet [Thu, 28 Jan 2021 15:25:35 +0000 (16:25 +0100)]
NEWS

3 years agoFix #80682 opcache doesn't honour pcre.jit option
Remi Collet [Thu, 28 Jan 2021 15:24:39 +0000 (16:24 +0100)]
Fix #80682 opcache doesn't honour pcre.jit option

3 years agoMerge branch 'PHP-7.3' into PHP-7.4
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

3 years agoRm unneeded function
Stanislav Malyshev [Wed, 27 Jan 2021 08:13:43 +0000 (00:13 -0800)]
Rm unneeded function

3 years agoMerge branch 'PHP-7.3' into PHP-7.4
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

3 years agoAlternative 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>

3 years agoFix #70091: Phar does not mark UTF-8 filenames in ZIP archives
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.

3 years agoUpdate version
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.

3 years agoFix #75850: Unclear error message wrt. __halt_compiler() w/o semicolon
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.

3 years agoUpdated to version 2021.1 (2021a)
Derick Rethans [Mon, 25 Jan 2021 10:44:05 +0000 (10:44 +0000)]
Updated to version 2021.1 (2021a)

3 years agoEmpty merge
Derick Rethans [Mon, 25 Jan 2021 10:44:05 +0000 (10:44 +0000)]
Empty merge

3 years agoUpdated to version 2021.1 (2021a)
Derick Rethans [Mon, 25 Jan 2021 10:44:04 +0000 (10:44 +0000)]
Updated to version 2021.1 (2021a)

3 years agoAdd missing SKIPIF clause for recently introduced test case
Christoph M. Becker [Thu, 21 Jan 2021 16:16:54 +0000 (17:16 +0100)]
Add missing SKIPIF clause for recently introduced test case

3 years agoFix #80648: Fix for bug 79296 should be based on runtime version
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.

3 years agoAdd missing SKIPIF clauses to new test cases
Christoph M. Becker [Wed, 20 Jan 2021 09:59:37 +0000 (10:59 +0100)]
Add missing SKIPIF clauses to new test cases

3 years agoUpdate NEWS and version
Derick Rethans [Tue, 19 Jan 2021 14:58:38 +0000 (14:58 +0000)]
Update NEWS and version

3 years agoUpdate NEWS for PHP 7.4.15RC1
Derick Rethans [Tue, 19 Jan 2021 14:44:32 +0000 (14:44 +0000)]
Update NEWS for PHP 7.4.15RC1

3 years agoFixed bug #42560
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.

3 years agoFix #69279: Compressed ZIP Phar extractTo() creates garbage files
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.

3 years agoFix #80595: Resetting POSTFIELDS to empty array breaks request
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.

3 years agoRevert "Fix #76813: Access violation near NULL on source operand"
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.

3 years agoAvoid modifying the return value of readline_completion_function()
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.

3 years agoFix #77565: Incorrect locator detection in ZIP-based phars
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.

3 years agoFix memory leak in Phar::webPhar() on Windows
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.

3 years agogdbinit: use ____print_str to print htable keys
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.

3 years agoDisable non-cron travis jobs
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.

3 years ago[ci skip] Update NEWS
Stanislav Malyshev [Mon, 4 Jan 2021 09:46:32 +0000 (01:46 -0800)]
[ci skip] Update NEWS

3 years agoMerge branch 'PHP-7.3' into PHP-7.4
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

3 years ago[ci skip] Fix order
Stanislav Malyshev [Mon, 4 Jan 2021 09:45:04 +0000 (01:45 -0800)]
[ci skip] Fix order

3 years agoMerge branch 'PHP-7.3' into PHP-7.4
Stanislav Malyshev [Mon, 4 Jan 2021 09:44:18 +0000 (01:44 -0800)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  [ci skip] Unpdate NEWS

3 years ago[ci skip] Unpdate NEWS
Stanislav Malyshev [Mon, 4 Jan 2021 09:43:45 +0000 (01:43 -0800)]
[ci skip] Unpdate NEWS

3 years agoMerge branch 'PHP-7.3' into PHP-7.4
Stanislav Malyshev [Sat, 2 Jan 2021 05:07:15 +0000 (21:07 -0800)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #77423: parse_url() will deliver a wrong host to user

3 years agoMerge branch 'PHP-7.2' into PHP-7.3
Stanislav Malyshev [Sat, 2 Jan 2021 05:06:07 +0000 (21:06 -0800)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix #77423: parse_url() will deliver a wrong host to user

3 years agoFix #77423: parse_url() will deliver a wrong host to user PHP-7.2
Christoph M. Becker [Wed, 13 May 2020 07:36:52 +0000 (09:36 +0200)]
Fix #77423: parse_url() will deliver a wrong host to user

To avoid that `parse_url()` returns an erroneous host, which would be
valid for `FILTER_VALIDATE_URL`, we make sure that only userinfo which
is valid according to RFC 3986 is treated as such.

For consistency with the existing url parsing code, we use ctype
functions, although that is not necessarily correct.

3 years agoReplace sort() function calls with ksort() in basic ksort test
haszi [Sun, 27 Dec 2020 16:03:41 +0000 (17:03 +0100)]
Replace sort() function calls with ksort() in basic ksort test

Closes GH-6541.

4 years agoFix #80384: limit read buffer size
Adam Seitz [Tue, 1 Dec 2020 23:40:16 +0000 (00:40 +0100)]
Fix #80384: limit read buffer size

In the case of a stream with no filters, php_stream_fill_read_buffer
only reads stream->chunk_size into the read buffer. If the stream has
filters attached, it could unnecessarily buffer a large amount of data.

With this change, php_stream_fill_read_buffer only proceeds until either
the requested size or stream->chunk_size is available in the read buffer.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Closes GH-6444.

4 years agoFixed bug #80376 (last day of the month causes runway cpu usage)
Derick Rethans [Mon, 21 Dec 2020 10:30:40 +0000 (10:30 +0000)]
Fixed bug #80376 (last day of the month causes runway cpu usage)

4 years agoMySQLnd: Support cursors in store/get result
Nikita Popov [Wed, 16 Dec 2020 11:12:06 +0000 (12:12 +0100)]
MySQLnd: Support cursors in store/get result

This fixes two related issues:

1. When a PS with cursor is used in store_result/get_result,
   perform a COM_FETCH with maximum number of rows rather than
   silently switching to an unbuffered result set (in the case of
   store_result) or erroring (in the case of get_result).
   In the future, we might want to make get_result unbuffered for
   PS with cursors, as using cursors with buffered result sets
   doesn't really make sense. Unlike store_result, get_result
   isn't very explicit about what kind of result set is desired.
2. If the client did not request a cursor, but the server reports
   that a cursor exists, ignore this and treat the PS as if it
   has no cursor (i.e. to not use COM_FETCH). It appears to be a
   server side bug that a cursor used inside an SP will be reported
   to the client, even though the client cannot use the cursor.

Fixes bug #64638, bug #72862, bug #77935.

Closes GH-6518.

4 years agoFixed bug #67983
Nikita Popov [Wed, 16 Dec 2020 09:52:27 +0000 (10:52 +0100)]
Fixed bug #67983

We need to check the BIT case first, otherwise it will get skipped
in INT_AND_FLOAT_NATIVE mode.

4 years agoFix bug #80523
Nikita Popov [Wed, 16 Dec 2020 09:16:50 +0000 (10:16 +0100)]
Fix bug #80523

Don't truncate the file length to unsigned int...

I have no idea whether that fully fixes the problem because the
process gets OOM killed before finishing, but at least the
immediate parse error is gone now.