Commit Graph

113948 Commits

Author SHA1 Message Date
Christoph M. Becker
ea3afcbae3 Enable UBSan in addition to ASan
UBSan is a useful tool, so we enable it for `--enable-sanitizer` in
addition to ASan.
2020-01-23 12:00:11 +01:00
Christoph M. Becker
4130fe437a Make MSVCRT memory leak checking usable for the test suite
While basic support for MSVCRT debugging has been added long
ago[1], the leak checking is not usable for the test suite, because we
are no longer calling `xmlCleanupParser()` on RSHUTDOWN of
ext/libxml[2], and therefore a few bogus leaks are reported whenever
ext/libxml is unloaded.

We therefore ignore memory leaks for this case.  We introduce
`ZEND_IGNORE_LEAKS_BEGIN()` and `ZEND_IGNORE_LEAKS_END()` to keep
those ignores better readable, and also because these *might* be
useful for other leak checkers as well.

We also explicitly free the `zend_handlers_table` and the `p5s` to
avoid spurious leak reports.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=d756e1db2324c1f4ab6f9b52e329959ce6a02bc3>
[2] <http://git.php.net/?p=php-src.git;a=commit;h=8742276eb3905eb97a585417000c7b8df85006d4>
2020-01-23 11:47:20 +01:00
Stanislav Malyshev
984d508825 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  More checks for php_strip_tags_ex
2020-01-22 23:06:28 -08:00
Stanislav Malyshev
dd3c664f8f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  More checks for php_strip_tags_ex
2020-01-22 22:41:56 -08:00
Stanislav Malyshev
2dc170e25d More checks for php_strip_tags_ex 2020-01-22 22:37:30 -08:00
Christoph M. Becker
496e6a8f3a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Don't leak encoding_str
2020-01-22 11:15:55 +01:00
Christoph M. Becker
f1bf4bf6eb Don't leak encoding_str 2020-01-22 11:15:16 +01:00
Christoph M. Becker
ab846173e2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79154: mb_convert_encoding() can modify $from_encoding
2020-01-22 10:30:25 +01:00
Christoph M. Becker
9be31a582a Fix #79154: mb_convert_encoding() can modify $from_encoding
We must not modify arrays passed by value.
2020-01-22 10:28:07 +01:00
Christoph M. Becker
94c9dc498f Fix #79149: SEGV in mb_convert_encoding with non-string encodings
We must not assume that `hash_entry` `IS_STRING`, but rather use
`encoding_str` which is guaranteed to be.
2020-01-22 09:43:51 +01:00
Remi Collet
d904be0880 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  next will be 7.2.28
2020-01-22 09:17:56 +01:00
Remi Collet
5a9475f4b9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  next will be 7.2.28
2020-01-22 09:17:33 +01:00
Remi Collet
7e2bd95fa5 next will be 7.2.28 2020-01-22 09:17:00 +01:00
Nikita Popov
59b3ab827a Avoid some @count() suppressions in run-tests.php 2020-01-21 18:49:59 +01:00
Nikita Popov
0aa09da486 Add sleep in FPM reload test
Explicitly mark the point where we have to wait.
2020-01-21 17:55:47 +01:00
Christoph M. Becker
16a8a608d5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79145: openssl memory leak
2020-01-21 16:20:04 +01:00
Christoph M. Becker
9eff906a02 Fix #79145: openssl memory leak
We must increase the refcount of `return_value` only if `cert` is a
resource; this is already done in `php_openssl_evp_from_zval()`,
though.
2020-01-21 16:17:25 +01:00
Christoph M. Becker
b0f8d38f4a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79146: cscript can fail to run on some systems
2020-01-21 11:54:11 +01:00
Deus Kane
3046e35718 Fix #79146: cscript can fail to run on some systems
In the buildconf and configure batch files, Windows' cscript utility was being
run without the /e:jscript flag. This works on systems that have not had the
default .js file association changed, but if .js has been re-associated to
(say) an IDE, the batch files fail with the error message:

Input Error: There is no script engine for file extension ".js".
2020-01-21 11:53:11 +01:00
Christoph M. Becker
54d9f2bb37 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS wrt. sec fixes
2020-01-21 11:48:48 +01:00
Nikita Popov
f5c5f7c05b Fix file clash in bug54446.phpt tests 2020-01-21 11:39:13 +01:00
Christoph M. Becker
b67fc51859 Update NEWS wrt. sec fixes 2020-01-21 11:31:14 +01:00
Stanislav Malyshev
a29c793381 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
  Fix bug #79037 (global buffer-overflow in `mbfl_filt_conv_big5_wchar`)
  Fix #79099: OOB read in php_strip_tags_ex
  Fix #79091: heap use-after-free in session_create_id()
2020-01-20 22:47:01 -08:00
Stanislav Malyshev
25ec7eb346 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
  Fix bug #79037 (global buffer-overflow in `mbfl_filt_conv_big5_wchar`)
  Fix #79099: OOB read in php_strip_tags_ex
  Fix #79091: heap use-after-free in session_create_id()
2020-01-20 22:46:29 -08:00
Stanislav Malyshev
5c90f8eb66 Update NEWS 2020-01-20 22:12:32 -08:00
Stanislav Malyshev
2bcbc95f03 Fix bug #79037 (global buffer-overflow in mbfl_filt_conv_big5_wchar) 2020-01-20 21:43:42 -08:00
Stanislav Malyshev
0f79b1bf30 Fix #79099: OOB read in php_strip_tags_ex 2020-01-20 21:43:42 -08:00
Christoph M. Becker
f79c774274 Fix #79091: heap use-after-free in session_create_id()
If the `new_id` is released, we must not use it again.
2020-01-20 21:43:42 -08:00
Nikita Popov
74380465ec Fix bug #79112: IMAP can't find OpenSSL during configure
Remove the check of PHP_OPENSSL inside SETUP_OPENSSL. It's the
responsibility of the caller to determine whether they want to
enable openssl or not. This makes SSL detection in IMAP work,
which uses a different option.

Additionally also clarify that --with-openssl-dir cannot actually
be used to specify an OpenSSL directory -- these options just
serve as a way to enable OpenSSL in extensions without also
enabling the OpenSSL extension. They need to be renamed to
something clearer in master.

Closes GH-5091.
2020-01-20 09:59:27 +01:00
Nikita Popov
b6506ab32a Increase timeout in mysqli_reap_async_query test
The 2000 here is 2ms, which is a bit optimistic for parallelized
testing.
2020-01-20 09:53:54 +01:00
Xinchen Hui
2958cdc0b5 Let's make this safer from maliciously crafted filename 2020-01-20 12:33:37 +08:00
Xinchen Hui
dda2addab2 minor cleanup 2020-01-20 12:28:57 +08:00
Xinchen Hui
9c2fd55d01 Fixed bug #79114 (Eval class during preload causes class to be only half available) 2020-01-20 12:24:49 +08:00
Nikita Popov
384dfe331b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79115
2020-01-17 11:38:10 +01:00
Nikita Popov
07bda97e76 Fixed bug #79115 2020-01-17 11:37:35 +01:00
aand18
4d24f5a494 Update php.ini files to add missing FTP extension
FTP functionality isn't enabled by default and not listed as a disabled
extension in the `php.ini` file either.

This should spare a few googles to anyone needing FTP functionality in PHP.

Closes GH-5084.
2020-01-17 09:51:18 +01:00
Nikita Popov
9f65afca71 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #71876
2020-01-17 09:48:42 +01:00
Nikita Popov
018251a7c4 Fixed bug #71876
This is a backport of fcdc0a6db0
to the PHP-7.3 branch. We need to make sure that OnUpdateString
is also called for a NULL value, otherwise the reset of the encoding
at the end of the request will not work.

I believe I already tried to land this before once, but it didn't
actually end up on the PHP-7.3 branch due to a push conflict that
I only noticed just now.
2020-01-17 09:47:31 +01:00
Christoph M. Becker
c9908ee5eb Disable optimizations for ASan instrumented builds
ASan instrumentation does not support the MSVC debug runtime, but still
it does not make sense to enable optimizations for such builds, since
they are not meant for production usage anyway, and although memory
corruption issues are still found in optimized builds, the generated
diagnostics are close to being useless, and apparently sometimes even
outright wrong.  Therefore, we disable all optimizations for ASan
instrumented builds.

We also introduce and use `ZEND_WIN32_NEVER_INLINE` for ASan enabled
builds to avoid inlining of functions, so we get even better
diagnostics.
2020-01-16 13:57:21 +01:00
Christoph M. Becker
05f3cd23ed Fix #79096: FFI Struct Segfault
We must not assume that the size of a function's return value is at
most `sizeof(ffi_arg)`, but rather have to use the size which already
has been determined for the return type if it is larger than
`sizeof(ffi_arg)`.

To be able to have a regression test, we export the required test
function from the zend-test extension, and make sure that the test
can be run on different platforms regardless of whether zend-tests was
built statically or dynamically.
2020-01-14 16:46:58 +01:00
Christoph M. Becker
b0cdd8cc53 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79084: mysqlnd may fetch wrong column indexes with MYSQLI_BOTH
2020-01-13 13:23:12 +01:00
Christoph M. Becker
1752393bb4 Fix #79084: mysqlnd may fetch wrong column indexes with MYSQLI_BOTH
Column names can be numeric strings, so we have to make sure to insert
the column values with the appropriate numeric keys, instead of adding
them.
2020-01-13 13:21:45 +01:00
Nikita Popov
c247898949 Fix test
Hopefully (32-bit)
2020-01-13 10:09:58 +01:00
Christoph M. Becker
0ab53f1636 Bring back test case support for older MySQL versions
These test cases have recently been adjusted to work with MySQL 8[1],
but some older, but still supported database versions, such as MySQL
5.6, still need the password to be sent hashed, so we fall back to
using `PASSWORD()`, if the `SET PASSWORD` query fails without it.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=b0efd18f7844da29931737b8a1cf461c7493e168>.
2020-01-11 11:21:26 +01:00
Christoph M. Becker
1ef8d5d65b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test cases which fail on Windows debug builds
2020-01-10 20:01:28 +01:00
Christoph M. Becker
f6dea34831 Fix test cases which fail on Windows debug builds
We use the portable {TMP} instead of the hard-coded /tmp, and skip
mysqli_debug_append.phpt on Windows, because unlinking the trace file
while the connection is still open won't work there.

(cherry picked from commit 60081ca20d)
2020-01-10 20:00:31 +01:00
Nikita Popov
e748a5a0e6 Remove unnecessary whitespace sensitivtiy from some tests 2020-01-10 17:36:46 +01:00
Christoph M. Becker
e8a86b1a00 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test for Windows ZTS builds
2020-01-11 06:16:03 +14:00
Christoph M. Becker
bc529b92ee Fix test for Windows ZTS builds
Cf. <https://bugs.php.net/bug.php?id=61685#1578672905>.
2020-01-11 06:15:32 +14:00
Christoph M. Becker
bf629baa9c Silence potential taskkill error messages
That test is still intermittently failing, because failure to kill the
child process is reported.  Therefore we silence these error messages.
2020-01-09 19:01:37 +01:00