]> granicus.if.org Git - php/log
php
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.

4 years agoPrepare for 7.4.15
Derick Rethans [Tue, 15 Dec 2020 14:13:29 +0000 (14:13 +0000)]
Prepare for 7.4.15

4 years agoFix #77322: PharData::addEmptyDir('/') Possible integer overflow
Christoph M. Becker [Fri, 11 Dec 2020 15:47:42 +0000 (16:47 +0100)]
Fix #77322: PharData::addEmptyDir('/') Possible integer overflow

`phar_path_check()` already strips a leading slash, so we must not
attempt to strip the trailing slash from an now empty directory name.

Closes GH-6508.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 15 Dec 2020 10:30:46 +0000 (11:30 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  7.3.27 is next

4 years ago7.3.27 is next
Christoph M. Becker [Tue, 15 Dec 2020 10:28:01 +0000 (11:28 +0100)]
7.3.27 is next

4 years agoIBM i PASE doesn't support ITIMER_PROF
Calvin Buckley [Thu, 10 Dec 2020 18:25:32 +0000 (14:25 -0400)]
IBM i PASE doesn't support ITIMER_PROF

Like Cygwin, this platform needs to use a real-time timer.

This was based on a patch by @kadler, but it didn't handle unsetting
the timer, so the timeout would continue to be active, triggering
`hard_timeout` unexpectedly. The patch is fixed to handle unsetting.

Closes GH-6503.

4 years agoDrop pdo_mysql_prepare_load_data.phpt
Christoph M. Becker [Fri, 11 Dec 2020 18:20:16 +0000 (19:20 +0100)]
Drop pdo_mysql_prepare_load_data.phpt

Like the test title and some comments in this test describe, this test
was supposed to have `::prepare()` failing because `LOAD DATA INFILE`
would not be supported as prepared statement, and then the test checks
whether follow-up queries would succeed.  However, `LOAD DATA INFILE`
is supported for prepared statements at least on Windows with mysqlnd,
so the test does no longer test what it is supposed to do.  Therefore,
we drop it.

Closes GH-6509.

4 years agoFix bug #69625: FPM returns 200 status on request without SCRIPT_FILENAME
Jakub Zelenka [Sat, 28 Nov 2020 21:27:53 +0000 (21:27 +0000)]
Fix bug #69625: FPM returns 200 status on request without SCRIPT_FILENAME

4 years agoFixed bug #76815
Nikita Popov [Thu, 10 Dec 2020 10:21:06 +0000 (11:21 +0100)]
Fixed bug #76815

When we receive an error while reading a result set, we should
assume that no more result sets are available. libmysqlclient
implements the same behavior.

4 years agoFixed bug #71145
Nikita Popov [Thu, 10 Dec 2020 09:28:10 +0000 (10:28 +0100)]
Fixed bug #71145

Consume any additional result sets when running INIT_COMMAND.

4 years agoBackport fix for bug #70066
Nikita Popov [Wed, 9 Dec 2020 16:24:30 +0000 (17:24 +0100)]
Backport fix for bug #70066

Given the number of duplicates this bug report had, it seems
worthwhile to fix this on PHP-7.4 as well.

Cherry-pick of 106e7e4bca7c0fd975eb219b18e3c34957ba8657.

4 years agoFixed bug #78154
Nikita Popov [Wed, 9 Dec 2020 11:46:47 +0000 (12:46 +0100)]
Fixed bug #78154

Handle errors during next_result in exec.

4 years agoFix #48725: Support for flushing in zlib stream
Christoph M. Becker [Wed, 19 Aug 2020 16:19:08 +0000 (18:19 +0200)]
Fix #48725: Support for flushing in zlib stream

When `php_zlib_deflate_filter()` is called with `PSFS_FLAG_FLUSH_INC`
but without new buckets being available (e.g. because a user calls
`rewind()` after writing to the stream), we have to make sure that any
pending data are flushed.  This could basically be done like in the
attached patch[1], but that could cause unnessary flushes, which can be
harmful for compression, and adds unnecessary flush markers to the
stream.  Thus, we use the `php_zlib_filter_data.finished` field, which
has not been used for `zlib.deflate` filters, and properly keep track
of the need to flush.

[1] <https://bugs.php.net/patch-display.php?bug_id=48725&patch=zlib-filter-flush-fix.patch&revision=latest>

Closes GH-6019.

4 years agoFix #77069: stream filter loses final block of data
Christoph M. Becker [Tue, 22 Sep 2020 14:02:01 +0000 (16:02 +0200)]
Fix #77069: stream filter loses final block of data

Reading from a stream may return greater than zero, but nonetheless the
stream's EOF flag may have been set.  We have to cater to this
condition by setting the close flag for filters.

We also have to cater to that change in the zlib.inflate filter:

If `inflate()` is called with flush mode `Z_FINISH`, but the output
buffer is not large enough to inflate all available data, it fails with
`Z_BUF_ERROR`.  However, `Z_BUF_ERROR` is not fatal; in fact, the zlib
manual states: "If deflate returns with Z_OK or Z_BUF_ERROR, this
function must be called again with Z_FINISH and more output space
(updated avail_out) but no more input data, until it returns with
Z_STREAM_END or an error."  Hence, we do so.

Closes GH-6001.

4 years agoFixed bug #63185
Nikita Popov [Tue, 8 Dec 2020 10:30:54 +0000 (11:30 +0100)]
Fixed bug #63185

4 years agoFixed bug #80458
Dharman [Wed, 2 Dec 2020 21:24:20 +0000 (21:24 +0000)]
Fixed bug #80458

If there is no result set (e.g. for upsert queries), still allow
fetching to occur without error, i.e. treat it the same way as
an empty result set.

This normalizes behavior between native and emulated prepared
statements and addresses a regression in PHP 7.4.13.

4 years agoFix #75102: `PharData` says invalid checksum for valid tar
Christoph M. Becker [Wed, 2 Dec 2020 13:49:43 +0000 (14:49 +0100)]
Fix #75102: `PharData` says invalid checksum for valid tar

Apparently, there are broken tarballs out there which are actually in
ustar format, but did not write the `ustar` marker.  Since popular tar
tools like GNU tar and 7zip have no issues dealing with such tarballs,
Phar should also be more resilient.

Thus, when the first checksum check of a tarball in (presumed) in old-
style format fails, we check whether the checksum would be suitable for
ustar format; if so, we treat the tarball as being in ustar format.

Closes GH-6479.

4 years agoUpload coverage data to codecov.io
Paul Crovella [Thu, 3 Dec 2020 03:14:09 +0000 (19:14 -0800)]
Upload coverage data to codecov.io

Closes GH-6486.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Thu, 3 Dec 2020 09:56:53 +0000 (10:56 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix mysqli_expire_password test for mariadb

4 years agoFix mysqli_expire_password test for mariadb
Daniel Black [Wed, 2 Dec 2020 21:39:08 +0000 (08:39 +1100)]
Fix mysqli_expire_password test for mariadb

In MariaDB-10.4.3 EXPIRE passwords where supported for
MariaDB. This only behaves like MySQL when the system
variable disconnect_on_expired_passwords=1.

MariaDB if there was no password it could not be considered
expired. So the test is adjusted to use actual passwords.
(MariaDB commit a94b20a8e0d9e64eeaabdaaa7a3e03fcdb8a686e)

The error codes produced my MariaDB are different
however still conforming to the SQL specification.

Closes GH-6480.

4 years agofix mysqli_stmt_get_result_metadata_fetch_field test for mariadb
Daniel Black [Thu, 3 Dec 2020 01:02:55 +0000 (12:02 +1100)]
fix mysqli_stmt_get_result_metadata_fetch_field test for mariadb

MariaDB extended the default decimal field to 39 characters
instead of MySQL's 31 characters.

This small change allows the test to pass on MySQL and MariaDB.

Closes GH-6484.

4 years agoBackport fix for bug #78750
Peter Kokot [Sun, 7 Jun 2020 19:53:39 +0000 (21:53 +0200)]
Backport fix for bug #78750

Cherry-picks
fe2afef36fc78c267133ddd403f48e0ee799efbc
and
86e2b7bb70131b48636cded57e5bc62b81b79865.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Wed, 2 Dec 2020 10:29:06 +0000 (11:29 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #80457

4 years agoFixed bug #80457
Nikita Popov [Wed, 2 Dec 2020 10:26:10 +0000 (11:26 +0100)]
Fixed bug #80457

On x32 sizeof(size_t) != sizeof(zend_long), so we need to be
careful with sign extension here.

Patch by bruno dot premont at restena dot lu.

4 years agoFix #73809: Phar Zip parse crash - mmap fail
Christoph M. Becker [Tue, 1 Dec 2020 13:20:39 +0000 (14:20 +0100)]
Fix #73809: Phar Zip parse crash - mmap fail

Phar signatures practically are of limited size; for the MD5 and SHA
hashes the size is fixed (at most 64 bytes for SHA512); for OpenSSL
public keys there is no size limit in theory, but "64 KiB ought to be
good enough for anybody".  So we check for that limit, to avoid fatal
errors due to out of memory conditions.

Since it is neither possible to have the signature compressed in the
ZIP archive, nor is it possible to manually add a signature via Phar,
we use ZipArchive to create a suitable archive for the test on the fly.

Closes GH-6474.

4 years agoNext attempt to fix bug #80368
Nikita Popov [Mon, 30 Nov 2020 14:15:59 +0000 (15:15 +0100)]
Next attempt to fix bug #80368

Apparently treating LibreSSL as OpenSSL 1.1 is not just something
we did in our code, it's something that upstream LibreSSL claims,
despite not actually being compatible. Duh.

Check for EVP_CIPH_OCB_MODE instead, which should reliably
determine support...

4 years agoFix #76813: Access violation near NULL on source operand
Christoph M. Becker [Sat, 28 Nov 2020 12:47:37 +0000 (13:47 +0100)]
Fix #76813: Access violation near NULL on source operand

We avoid `YYCURSOR` becoming `NULL` by initializing `YYMARKER`, and add
a default rule for `<NORMAL>` where we catch unexpected input.

We also fix the only superficially related issue regarding empty input
followed by `T_SEPARATOR` and command, which caused another segfault.

Closes GH-6464.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Jakub Zelenka [Fri, 27 Nov 2020 16:33:47 +0000 (16:33 +0000)]
Merge branch 'PHP-7.3' into PHP-7.4

4 years agoFix test for bug62890 to not depend on system cert store
Jakub Zelenka [Fri, 27 Nov 2020 16:32:43 +0000 (16:32 +0000)]
Fix test for bug62890 to not depend on system cert store

4 years agoFix build for non-x86
Nikita Popov [Fri, 27 Nov 2020 16:04:17 +0000 (17:04 +0100)]
Fix build for non-x86

4 years agoFix AVX detection
Nikita Popov [Fri, 27 Nov 2020 10:54:39 +0000 (11:54 +0100)]
Fix AVX detection

Our CPU detection code currently only checks whether hardware
support for AVX exists. However, we also need to check for operating
system support for XSAVE, as well as whether XCR0 has the SSE and
AVX bits set.

If this is not the case, unset the AVX and AVX2 bits in the cpuinfo
structure.

Hopefully this resolves our issues with CPU support detection.

Closes GH-6460.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Fri, 27 Nov 2020 10:50:59 +0000 (11:50 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix mysqli_get_client_stats test

4 years agoFix mysqli_get_client_stats test
Daniel Black [Fri, 27 Nov 2020 05:43:20 +0000 (16:43 +1100)]
Fix mysqli_get_client_stats test

MySQL removed RENAME DATABASE in 18300001c1dbbfddf9a0adcbaeea68956102bdd0
(Sept 2007, 5.1.23). As this briefest existance is very insignificant lets remove it.

It also breaks when testing against MariaDB.

As the alternate path in this test covers all supported MySQL and MariaDB
versions and a signifant portion of unsupported versions lets keep it simple.

Closes GH-6459.

4 years agoFixed bug #80368
Nikita Popov [Fri, 27 Nov 2020 09:57:19 +0000 (10:57 +0100)]
Fixed bug #80368

We assume that usually LibreSSL supports everything OpenSSL 1.1 does.
In this instance, this is not the case.

4 years agoFixed bug #80425
Nikita Popov [Fri, 27 Nov 2020 09:02:00 +0000 (10:02 +0100)]
Fixed bug #80425

Rename the methods in MessageFormatAdapter to make sure they don't
clash with anything defined by icu itself, which may be a problem
if icu is linked statically.

4 years agoFix bug #80402: Don't strip -lpthread
Nikita Popov [Tue, 24 Nov 2020 11:23:03 +0000 (12:23 +0100)]
Fix bug #80402: Don't strip -lpthread

The current behavior has been introduced 20 years ago in
f9e375f493a1aeacbbcc8f2f00880d05b4ba7aaf as part of a larger change.
It's not clear to me why special treatement of -lpthread is necessary
here.

4 years agoFixed bug #80411
Nikita Popov [Wed, 25 Nov 2020 16:23:42 +0000 (17:23 +0100)]
Fixed bug #80411

References to null-serializations are stored as null, and as such
are part of the reference count.

Reminds me that we really need to deprecate the mess that is
Serializable.

4 years agoFixed error reporting in mysqli_stmt::__construct
Dharman [Tue, 24 Nov 2020 23:02:04 +0000 (23:02 +0000)]
Fixed error reporting in mysqli_stmt::__construct

For the sake of simplicity, I've synchronized the implementation
with PHP 8, which means null values are also accepted.

Closes GH-6454.

4 years agoReindent more mysqli tests
Nikita Popov [Wed, 25 Nov 2020 15:07:16 +0000 (16:07 +0100)]
Reindent more mysqli tests

Due to a bug in the tidy script, most tests did not actually get
reindented...

4 years agoReindent ext/mysqli tests
Nikita Popov [Wed, 25 Nov 2020 14:57:11 +0000 (15:57 +0100)]
Reindent ext/mysqli tests

Reindent ext/mysqli tests on PHP-7.4, so they match with the
indentation on PHP-8.0. Otherwise merging test changes across
branches is very unpleasant.

4 years agoFix usage of casted string in ReflectionParameter ctor
Nikita Popov [Tue, 24 Nov 2020 15:41:18 +0000 (16:41 +0100)]
Fix usage of casted string in ReflectionParameter ctor

Fixes oss-fuzz #27755.

4 years agoFixed bug #80393
Nikita Popov [Tue, 24 Nov 2020 14:26:40 +0000 (15:26 +0100)]
Fixed bug #80393

Handle macos versions that don't start with 10.* in libtool.

Patch by kir dot morozov at gmail dot com.

4 years agoFix #77961: finfo_open crafted magic parsing SIGABRT
Christoph M. Becker [Mon, 23 Nov 2020 16:12:46 +0000 (17:12 +0100)]
Fix #77961: finfo_open crafted magic parsing SIGABRT

libmagic may abort the running process, which is not desirable for PHP;
we raise a fatal error instead.

Closes GH-6437.

4 years agoFix #80366: Return Value of zend_fstat() not Checked
Christoph M. Becker [Tue, 17 Nov 2020 13:42:22 +0000 (14:42 +0100)]
Fix #80366: Return Value of zend_fstat() not Checked

In the somewhat unlikely case that `zend_fstat()` fails, we must not
proceed executing the function, but return `false` instead.

Patch based on the patch contributed by sagpant at microsoft dot com.

Closes GH-6432.

4 years agoFixed bug #80362: Running dtrace scripts can cause php to crash
Nikita Popov [Tue, 24 Nov 2020 12:00:53 +0000 (13:00 +0100)]
Fixed bug #80362: Running dtrace scripts can cause php to crash

Patch by al at coralnet dot name.

4 years agoFix #77594: ob_tidyhandler is never reset
Christoph M. Becker [Sat, 14 Nov 2020 14:03:58 +0000 (15:03 +0100)]
Fix #77594: ob_tidyhandler is never reset

We reset to original INI value on request shutdown.

Closes GH-6425.

4 years agoFix typos in php.ini files
Benjamin Morel [Fri, 20 Nov 2020 13:45:35 +0000 (14:45 +0100)]
Fix typos in php.ini files

Closes GH-6441.

[ci skip]

4 years agoFix #72964: White space not unfolded for CC/Bcc headers
Christoph M. Becker [Tue, 10 Nov 2020 15:13:54 +0000 (16:13 +0100)]
Fix #72964: White space not unfolded for CC/Bcc headers

`\r\n` does only terminate a header, if not followed by `\t` or ` `.
We have to cater to that when determining the end position of the
respective headers.

Closes GH-6420.

4 years agoFix #80345: PHPIZE configuration has outdated PHP_RELEASE_VERSION
Christoph M. Becker [Tue, 10 Nov 2020 12:51:40 +0000 (13:51 +0100)]
Fix #80345: PHPIZE configuration has outdated PHP_RELEASE_VERSION

We must not redefine the version "constants" for phpize builds, because
these have already generated in phpize.js, from where we pass these
variables forward to configure.js.

We also add `PHP_EXTRA_VERSION` and `PHP_VERSION_STRING` to the files
for completeness.

Closes GH-6419.

4 years agoShort-circuit get_gc for currently running generator
Nikita Popov [Wed, 18 Nov 2020 11:44:31 +0000 (12:44 +0100)]
Short-circuit get_gc for currently running generator

4 years agoFix #80312: change default engine from MyISAM to InnoDB in tests
Darek Slusarczyk [Fri, 6 Nov 2020 14:41:15 +0000 (15:41 +0100)]
Fix #80312: change default engine from MyISAM to InnoDB in tests

Change mysqli and pdo_mysql tests configuration to use by default
InnoDB instead of MyISAM.

Closes GH-6405.

4 years agoFix incorrectly optimized out live range
Nikita Popov [Tue, 17 Nov 2020 09:18:37 +0000 (10:18 +0100)]
Fix incorrectly optimized out live range

For x ? y : z style structures, the live range starts at z, but
may also hold the value of y. Make sure that the refcounting check
takes this into account, by checking the type of a potential phi
user.

4 years agoFix #74558: Can't rebind closure returned by Closure::fromCallable()
Christoph M. Becker [Thu, 12 Nov 2020 14:37:51 +0000 (15:37 +0100)]
Fix #74558: Can't rebind closure returned by Closure::fromCallable()

Failure to rebind such closures is not necessarily related to them
being created by `ReflectionFunctionAbstract::getClosure()`, so we fix
the error message.

Closes GH-6424.

4 years agoHandle errors during next_result()
Nikita Popov [Wed, 11 Nov 2020 14:56:05 +0000 (15:56 +0100)]
Handle errors during next_result()

4 years agoPHP-7.4 is now for 7.4.14
Derick Rethans [Tue, 10 Nov 2020 17:58:21 +0000 (17:58 +0000)]
PHP-7.4 is now for 7.4.14

4 years agoAdd integration test for symfony preloading
Nikita Popov [Mon, 9 Nov 2020 14:13:33 +0000 (15:13 +0100)]
Add integration test for symfony preloading

To help catch regressions like the one that occurred in PHP 7.4.12.

Closes GH-6414.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 10 Nov 2020 10:09:40 +0000 (11:09 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  7.3.26 is next

4 years ago7.3.26 is next
Christoph M. Becker [Tue, 10 Nov 2020 10:08:16 +0000 (11:08 +0100)]
7.3.26 is next