Commit Graph

115042 Commits

Author SHA1 Message Date
Paul Crovella
8f8e6f95af Upload coverage data to codecov.io
Closes GH-6486.
2020-12-03 12:04:50 +01:00
Nikita Popov
0f6c41c6f8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix mysqli_expire_password test for mariadb
2020-12-03 11:01:57 +01:00
Daniel Black
0697a64f7e 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.
2020-12-03 10:56:00 +01:00
Daniel Black
5d5c1cea5f 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.
2020-12-03 10:45:11 +01:00
Peter Kokot
d386ed1e6b Backport fix for bug #78750
Cherry-picks
fe2afef36f
and
86e2b7bb70.
2020-12-03 10:07:09 +01:00
Nikita Popov
f2833ca1be Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #80457
2020-12-02 11:29:06 +01:00
Nikita Popov
d6fcaf5da4 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.
2020-12-02 11:26:10 +01:00
Christoph M. Becker
c283f53b24 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.
2020-12-01 16:58:19 +01:00
Nikita Popov
ecee3f1209 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...
2020-11-30 15:15:59 +01:00
Christoph M. Becker
5e15c9c41f 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.
2020-11-30 12:29:24 +01:00
Jakub Zelenka
b855907f54 Merge branch 'PHP-7.3' into PHP-7.4 2020-11-27 16:33:47 +00:00
Jakub Zelenka
685708160e Fix test for bug62890 to not depend on system cert store 2020-11-27 16:32:43 +00:00
Nikita Popov
3430d856ac Fix build for non-x86 2020-11-27 17:04:17 +01:00
Nikita Popov
4e30ab33d8 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.
2020-11-27 14:49:31 +01:00
Christoph M. Becker
07c5efbd76 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix mysqli_get_client_stats test
2020-11-27 11:50:59 +01:00
Daniel Black
4a10037cb4 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.
2020-11-27 11:43:34 +01:00
Nikita Popov
0f579fd7c8 Fixed bug #80368
We assume that usually LibreSSL supports everything OpenSSL 1.1 does.
In this instance, this is not the case.
2020-11-27 10:57:19 +01:00
Nikita Popov
5240f8391f 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.
2020-11-27 10:02:00 +01:00
Nikita Popov
ea372e7463 Fix bug #80402: Don't strip -lpthread
The current behavior has been introduced 20 years ago in
f9e375f493 as part of a larger change.
It's not clear to me why special treatement of -lpthread is necessary
here.
2020-11-26 11:54:20 +01:00
Nikita Popov
2fb12be84c 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.
2020-11-25 17:23:42 +01:00
Dharman
233f507fe6 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.
2020-11-25 16:27:41 +01:00
Nikita Popov
e3e67b721f Reindent more mysqli tests
Due to a bug in the tidy script, most tests did not actually get
reindented...
2020-11-25 16:07:16 +01:00
Nikita Popov
97d192b444 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.
2020-11-25 15:57:11 +01:00
Nikita Popov
706241f82d Fix usage of casted string in ReflectionParameter ctor
Fixes oss-fuzz #27755.
2020-11-24 16:42:16 +01:00
Nikita Popov
d016434ad3 Fixed bug #80393
Handle macos versions that don't start with 10.* in libtool.

Patch by kir dot morozov at gmail dot com.
2020-11-24 15:26:40 +01:00
Christoph M. Becker
39f95f5614 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.
2020-11-24 14:01:15 +01:00
Christoph M. Becker
5f9c82d514 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.
2020-11-24 13:09:16 +01:00
Nikita Popov
fa713ec17b Fixed bug #80362: Running dtrace scripts can cause php to crash
Patch by al at coralnet dot name.
2020-11-24 13:01:51 +01:00
Christoph M. Becker
221345a013 Fix #77594: ob_tidyhandler is never reset
We reset to original INI value on request shutdown.

Closes GH-6425.
2020-11-22 14:02:29 +01:00
Benjamin Morel
ed949a1973 Fix typos in php.ini files
Closes GH-6441.

[ci skip]
2020-11-20 16:50:29 +01:00
Christoph M. Becker
881e43a03c 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.
2020-11-19 19:25:03 +01:00
Christoph M. Becker
c2b1182879 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.
2020-11-19 16:23:20 +01:00
Nikita Popov
99a8ec6e24 Short-circuit get_gc for currently running generator 2020-11-18 12:45:29 +01:00
Darek Slusarczyk
79a606bd95 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.
2020-11-17 13:15:15 +01:00
Nikita Popov
df7417d127 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.
2020-11-17 10:19:57 +01:00
Christoph M. Becker
78773890f6 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.
2020-11-16 14:31:06 +01:00
Nikita Popov
eda7492604 Handle errors during next_result() 2020-11-11 16:02:52 +01:00
Derick Rethans
c1f8dd4a33 PHP-7.4 is now for 7.4.14 2020-11-10 17:58:21 +00:00
Nikita Popov
f419e049ff Add integration test for symfony preloading
To help catch regressions like the one that occurred in PHP 7.4.12.

Closes GH-6414.
2020-11-10 11:45:22 +01:00
Christoph M. Becker
bd2b4a5b2e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  7.3.26 is next
2020-11-10 11:09:40 +01:00
Christoph M. Becker
b5ce6df0da 7.3.26 is next 2020-11-10 11:08:16 +01:00
Nikita Popov
d971b67027 Fix phi use chain management when renaming variable
If there is a previous use of the new variable in the phi, we need
to NULL out the use chain of the new source we're adding.

Test case is reduced from an assertion failure in the Symfony Demo.
2020-11-09 17:08:16 +01:00
Nikita Popov
96b725122d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #80310: Support for icu4c 68.1.
2020-11-09 14:34:24 +01:00
Alexander M. Turek
8eaaabdd58 Fixed bug #80310: Support for icu4c 68.1.
On stable versions, bring back the TRUE/FALSE defines by defining
_U_DEFINE_TRUE_AND_FALSE.

Closes GH-6397.
2020-11-09 14:31:29 +01:00
Derick Rethans
25643b56a2 Update version in 7.4 branch 2020-11-07 18:48:13 +00:00
Christoph M. Becker
77b6e95d92 Split tests for compatibility with ICU 68.1 2020-11-06 17:42:39 +01:00
Nikita Popov
6808968c89 Backport preloading trait fixup fixes
This cherry-picks 33969c2252 and
2effbfd871 from PHP-8.0.

The issues these commits fix could also manifest in PHP 7.4, and
a commenter on bug #80307 reports this this might indeed be
happening.
2020-11-05 16:35:08 +01:00
Christoph M. Becker
00e41a10b8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80266: parse_url silently drops port number 0
2020-11-04 14:54:32 +01:00
Christoph M. Becker
2cab085bb3 Fix #80266: parse_url silently drops port number 0
As of commit 81b2f3e[1], `parse_url()` accepts URLs with a zero port,
but does not report that port, what is wrong in hindsight.

Since the port number is stored as `unsigned short` there is no way to
distinguish between port zero and no port.  For BC reasons, we thus
introduce `parse_url_ex2()` which accepts an output parameter that
allows that distinction, and use the new function to fix the behavior.

The introduction of `parse_url_ex2()` has been suggested by Nikita.

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

Closes GH-6399.
2020-11-04 14:53:19 +01:00
Nikita Popov
e0d6c3f7ba Fix dynamic function definition in preload script
We should use normal function renaming if the function is declared
during preloading itself, rather than afterwards.

This fixes a regression introduced by
68f80be9d1.
2020-11-04 10:54:08 +01:00