Commit Graph

12173 Commits

Author SHA1 Message Date
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
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
b67fc51859 Update NEWS wrt. sec fixes 2020-01-21 11:31:14 +01: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
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
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
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
Christoph M. Becker
b2864b7cfd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79078: Hypothetical use-after-free in curl_multi_add_handle()
2020-01-08 18:31:38 +01:00
Christoph M. Becker
0dda4a844e Fix #79078: Hypothetical use-after-free in curl_multi_add_handle()
To avoid this, we have to verify the handlers already in
`curl_multi_add_handle()`, not only in `curl_multi_exec()`.
2020-01-08 18:29:10 +01:00
Christoph M. Becker
7ea4f0e47e Bump version 2020-01-08 18:26:14 +01:00
Christoph M. Becker
38c0a53b60 Bump version 2020-01-07 11:03:19 +01:00
Nikita Popov
59c3ddab13 Remove support for preloading on Windows
Due to ASLR restrictions, preloading on Windows does not work with
any code that has preloading dependencies on internal classes.
This effectively makes it unusable for any non-trivial codebase.

Instead of pretending like preloading is going to work, only to
make people realize that it really doesn't once they get beyond
a dummy example, we disable support for preloading on Windows
entirely.

Closes GH-4999.
2020-01-06 22:41:55 +01:00
Nikita Popov
846b647953 Throw Error when referencing uninit typed prop in __sleep
Previously this generated a notice, but would likely generate an
Error when unserializing.

Now we treat it with the same distinction as direct property
accesses, i.e. referencing an unset/undefined normal property
stays a notice, while a typed property becomes an Error exception.

This fixed bug #79002.

Closes GH-5050.
2020-01-06 18:47:27 +01:00
Christoph M. Becker
06e78cad83 Revert "Extend CURLFile to support streams"
This reverts commit 17a9f1401a, because
this commit would break ABI, and also due to bug #79013.
We keep the commit for PHP 7.4+, though.
2020-01-06 15:31:49 +01:00
Christoph M. Becker
09ebeba1af Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #54298: Using empty additional_headers adding extraneous CRLF
2020-01-06 14:48:46 +01:00
Christoph M. Becker
ae2150692a Fix #54298: Using empty additional_headers adding extraneous CRLF
If the header string is empty, we pass `NULL` to `php_mail()` to avoid
further checks on the string length.
2020-01-06 14:47:23 +01:00
Christoph M. Becker
74b11e3315 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79068: gdTransformAffineCopy() changes interpolation method
2020-01-06 10:38:22 +01:00
Christoph M. Becker
4bec59f175 Fix #79068: gdTransformAffineCopy() changes interpolation method
We port
<9088591eae>.
2020-01-06 10:36:48 +01:00
Nikita Popov
b59f760472 Fix bug #79063: Curl openssl does not respect PKG_CONFIG_PATH 2020-01-06 10:31:22 +01:00
Christoph M. Becker
f799f42ec8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79067: gdTransformAffineCopy() may use unitialized values
2020-01-06 09:37:40 +01:00
Christoph M. Becker
2c5860517c Fix #79067: gdTransformAffineCopy() may use unitialized values
We port
<7a06c1669c>.
2020-01-06 09:35:13 +01:00
Christoph M. Becker
f4aa0869ac Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78808: [LMDB] MDB_MAP_FULL: Environment mapsize limit reached
2020-01-03 18:51:07 +01:00
Christoph M. Becker
c05a069adf Fix #78808: [LMDB] MDB_MAP_FULL: Environment mapsize limit reached
We implement support for a fifth parameter, which allows to specify the
mapsize.  The parameter defaults to zero, in which case the compiled in
default mapsize (usually 1048576) will be used.  The mapsize should be
a multiple of the page size of the OS.
2020-01-03 18:49:12 +01:00
Christoph M. Becker
4c6ad099c6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78538: shmop memory leak
2020-01-03 18:13:04 +01:00
Christoph M. Becker
18172303f4 Fix #78538: shmop memory leak
If the descriptor's refcount drops to zero, we have to unmap the
respective file view, to avoid leaking memory.
2020-01-03 18:10:29 +01:00
Christoph M. Becker
40b2f82380 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79015: undefined-behavior in php_date.c
2020-01-03 14:32:30 +01:00
Christoph M. Becker
b48f2625b5 Fix #79015: undefined-behavior in php_date.c
We check that the given microsecond fraction is in the valid range
[0, 1000000[, and otherwise mark it as invalid.  We also drop the
useless do loop; a plain block is sufficient here.
2020-01-03 14:31:03 +01:00
Nikita Popov
1dcdcd79ba Fixed bug #79056 2020-01-03 11:08:48 +01:00
Nikita Popov
8abb2ced39 Fixed bug #79055
Fix file cache serialization of property types. I'm changing the
overall type serialization format to perform additional adjustments
in order to yield a plausible pointer for zend_type, rather than
using an entirely separate serialization format, as was previously
done. That would have been annoying to extend to the case of CE
pointers.
2020-01-02 15:53:15 +01:00
Nikita Popov
d1537e506e Fixed bug #79046 2019-12-30 17:23:53 +01:00
Christoph M. Becker
94063619a0 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79040: Warning Opcode handlers are unusable due to ASLR
2019-12-30 15:17:41 +01:00
Christoph M. Becker
0cecf83b26 Fix #79040: Warning Opcode handlers are unusable due to ASLR
We must not use the same shared memory OPcache instance for different
SAPIs, since their memory layout is different.  To avoid this, we add
the SAPI name (truncated to at most 20 characters) to the names of the
memory base file, the mutex and the file mapping.
2019-12-30 15:12:58 +01:00
Nikita Popov
fcaf7cbd64 Add test for bug #79031
Fixed by preceding revert.
2019-12-30 11:31:27 +01:00
Christoph M. Becker
6d1dff6f3d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79033: Curl timeout error with specific url and post
2019-12-28 10:48:59 +01:00
Christoph M. Becker
c47b18a222 Fix #79033: Curl timeout error with specific url and post
We must not set an empty mime structure as `CURLOPT_MIMEPOST`; instead
we set it to `NULL` if `CURLOPT_POSTFIELDS` has been set to an empty
array.
2019-12-28 10:47:03 +01:00
Christoph M. Becker
1b0a79ab3f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter).
2019-12-25 12:35:44 +01:00
Xinchen Hui
27bb3289ac Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter).
We backport the fix PHP 7.3, since this branch is affected as well.

(cherry picked from commit b5e0043796)
(cherry picked from commit e36daa6927)
(cherry picked from commit 2704ee6844)
2019-12-25 12:33:30 +01:00
Xinchen Hui
e36daa6927 Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter). 2019-12-25 15:55:15 +08:00
Xinchen Hui
4c6e170c57 Revert "Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter)"
This reverts commit d8ad2f4695.
2019-12-25 15:27:10 +08:00
Xinchen Hui
d8ad2f4695 Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter) 2019-12-25 13:14:08 +08:00
Xinchen Hui
153c9cc346 Fixed bug #79022 (class_exists returns True for classes that are not ready to be used) 2019-12-24 14:04:19 +08:00
Christoph M. Becker
6ec4056928 Fix #79008: General performance regression with PHP 7.4 on Windows
We no longer try to retrieve the filename of a given stream when
fstat'ing, because this is very slow.  Since we neither didn't do that
in PHP 7.3 and earlier, we regard this as sensible trade-off.
2019-12-20 16:28:11 +01:00
Nikita Popov
b0737fa35e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78982: pdo_pgsql returns dead persistent connection
2019-12-20 12:06:05 +01:00