Commit Graph

12705 Commits

Author SHA1 Message Date
Christoph M. Becker
5dcb8f2f1c Fix #72941: Modifying bucket->data by-ref has no effect any longer
To match the PHP 5 behavior, we have to explicitly cater to `buffer` or
`data` being references.

Closes GH-6096.
2020-09-08 18:06:40 +02:00
Nikita Popov
d0d9c3a980 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #80077
2020-09-08 10:01:13 +02:00
Nikita Popov
07cb665515 Fixed bug #80077
Quoting from the bug report:

> The domain names passed to getmxrr() do not contain a trailing dot.
> DNS lookups which do not find records will (depending on the local
> resolver config) try again by adding the local domain to the end of
> the searched host/domain. In many environments there's an mx record
> for any subdomain of the local domain and the MX query will return
> a hit. But the test expects no hit. So the test fails when checking
> that "qa.php.net" does not have an MX record in DNS. In our local
> environment the resolver falls back to also check qa.php.net.kippdata.de
> which does have an MX record. Using "qa.php.net." instead of "qa.php.net"
> should fix this for everyone.
2020-09-08 10:00:49 +02:00
Nikita Popov
2dabc4c305 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #80049
2020-09-03 17:12:58 +02:00
Nikita Popov
46a49be6c8 Fixed bug #80049
Type checking may convert to refcounted values, so force freeing
of extra args.
2020-09-03 17:12:40 +02:00
Christoph M. Becker
2f4a2a9316 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80048: Bug #69100 has not been fixed for Windows
2020-09-03 15:45:33 +02:00
Christoph M. Becker
1848ccdae2 Fix #80048: Bug #69100 has not been fixed for Windows
We fix the erroneous length calculation on Windows, too.

Closes GH-6067.
2020-09-03 15:43:19 +02:00
Nikita Popov
8516434a56 Fixed bug #80046
We already protect against optimizing away loop frees in DFA pass,
but not in block pass.
2020-09-03 11:19:04 +02:00
Nikita Popov
dfaa4768d2 Fix bug #80037
If we're accessing an uninitialized typed property and __get is
defined, don't perform a read_property callback, as __get is
supposed to have no effect on uninitialized typed properties.
Usually it doesn't, but by-reference assignments cannot be
performed through read_property.

I'm deleting the test for bug #80039 again, as it doesn't really
make sense anymore with this fix.
2020-08-31 12:17:00 +02:00
Matteo Beccati
42b6b8a3ae Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80027 Terrible performance using $query->fetch on queries with many bind parameters
2020-08-31 11:08:26 +02:00
Matteo Beccati
44ade0e875 Fix #80027 Terrible performance using $query->fetch on queries with many bind parameters
Added new flags that allow skipping param_evt(s) that are not used by drivers,
in a backwards and forward compatible manner. Updated the pgsql, mysql, sqlite
and oci drivers to properly use the new flags. I've left out pdo_dblib, which
doesn't have a param_hook, and pdo_firebird, which seems to be using
PARAM_EVT_NORMALIZE in a wrong context (param type vs event type).
2020-08-31 11:03:03 +02:00
Christoph M. Becker
1ff981d7a6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #64130: COM obj parameters passed by reference are not updated
2020-08-26 14:53:46 +02:00
Christoph M. Becker
5ff15e2651 Fix #64130: COM obj parameters passed by reference are not updated
`ITypeInfo_GetIDsOfNames()` is supposed to fail with `E_NOTIMPL` for
out-of-process servers, thus we should not remove the already available
typeinfo of the object in this case.

We also properly free the `byref_vals`.
2020-08-26 14:50:04 +02:00
Christoph M. Becker
6b6c2c003c Fix #79979: passing value to by-ref param via CUFA crashes
If a by-val send is not allowed, we must not do so.  Instead we wrap
the value in a temporary reference.

Closes GH-6000
2020-08-24 14:08:32 +02:00
Christoph M. Becker
5ab7b30cd6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79986: str_ireplace bug with diacritics characters
2020-08-24 11:09:38 +02:00
Christoph M. Becker
844a2dd6ac Fix #79986: str_ireplace bug with diacritics characters
`tolower()` returns an `int`, so we must not convert to `char` which
may be `signed` and as such may be subject to overflow (actually,
implementation defined behavior).

Closes GH-6007
2020-08-24 11:08:48 +02:00
Christoph M. Becker
10df94dd0e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80002: calc free space for new interned string is wrong
2020-08-24 11:04:03 +02:00
Christoph M. Becker
fcd26ffcc3 Fix #80002: calc free space for new interned string is wrong
We need to calculate the free size in bytes.

Patch contributed by t-matsuno.

Closes GH-6024
2020-08-24 11:03:19 +02:00
Christoph M. Becker
81fffa86b2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80007: Potential type confusion in unixtojd() parameter parsing
2020-08-22 12:31:07 +02:00
Andy Postnikov
b2a33ab06b Fix #80007: Potential type confusion in unixtojd() parameter parsing
Also it fixes test on 32-bit armv7 and x86
- Test unixtojd() function : error conditions [ext/calendar/tests/unixtojd_error1.phpt]

Closes GH-6033
2020-08-22 12:30:04 +02:00
Matteo Beccati
3877172411 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #47021: SoapClient stumbles over WSDL delivered with "Transfer-Encoding: chunked"
2020-08-18 18:27:26 +02:00
Matteo Beccati
f7c43b8c72 Fix #47021: SoapClient stumbles over WSDL delivered with "Transfer-Encoding: chunked" 2020-08-18 18:10:39 +02:00
Christoph M. Becker
ff14b7adad 7.3.23 is next 2020-08-18 09:55:37 +02:00
Derick Rethans
499bf91cd0 Prepare for 7.4.11 2020-08-18 08:06:20 +01:00
Nikita Popov
8bda799d6f Fixed bug #79724 2020-08-13 17:25:51 +02:00
Nikita Popov
981af26d7b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
2020-08-11 17:13:28 +02:00
Ahmed Abdou
2fe2e5b48f Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
PDO driver constructors are throwing PdoException without setting
errorInfo, so create a new reusable function that throws exceptions
for PDO and will also set the errorInfo. Use this function in
pdo_mysql, pdo_sqlite, and pdo_pgsql.
2020-08-11 17:12:48 +02:00
Nikita Popov
5c5508698d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #75785 by attempt switching endianness on Maker's Note
2020-08-11 16:27:06 +02:00
Nawarian
2fa4ca95db Fix bug #75785 by attempt switching endianness on Maker's Note
Different manufacturer models may come with a
different endianness (motorola/intel) format. In
order to avoid a big refactor and a gigantic lookup
table, this commit simply attempts to switch the
endianness and proceed when values are acceptable.

Closes GH-5849.
2020-08-11 16:26:34 +02:00
Nikita Popov
4609ded082 Fixed bug #79917
op_arrays can be shared on two levels: Either the op_array is
completely shared, or it is distinct but shares all members
(apart from static_variables).

The the op_array is distinct, we need to make sure to properly
initialize the MAP_PTR structures.
2020-08-11 14:58:54 +02:00
Christoph M. Becker
183b853dc6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #48585: com_load_typelib holds reference, fails on second call
2020-08-11 11:28:07 +02:00
Christoph M. Becker
dc108feab8 Fix #48585: com_load_typelib holds reference, fails on second call
Whether the type library is cached is actually irrelevant here; what
matters is that the symbols are imported, and since these are not
cached, we have to import them for every request.  And we cannot cache
the symbols, because the import depends on the current codepage, but
the codepage is a `PHP_INI_ALL` setting.
2020-08-11 11:26:50 +02:00
Nikita Popov
66d9f4d985 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79951
2020-08-11 10:35:25 +02:00
Nikita Popov
9d9dffe60a Fixed bug #79951
One branch did not release tmp_replace_entry_str.

Also reduce the scope of some variables.
2020-08-11 10:33:59 +02:00
Nikita Popov
5b8b480d23 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #79944
2020-08-10 20:43:13 +02:00
Nikita Popov
a06eed0c0e Fix bug #79944
Only return true from dns_get_mx if we actually found any MX record.
2020-08-10 20:42:50 +02:00
Christoph M. Becker
2830c3ef52 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79922: Crash after multiple calls to xml_parser_free()
2020-08-10 12:25:26 +02:00
Christoph M. Becker
0af3f49312 Fix #79922: Crash after multiple calls to xml_parser_free()
We must not call `zend_list_delete()` in resource closer functions
exposed to userland, because decreasing the refcount there leads to
use-after-free scenarios.  In this case, commit 4a42fbb worked for
typical use-cases where `xml_parser_free()` has been called exactly
once for the resource, because there is an internal zval (`->index`)
referencing the same resource which already increased the refcount by
one.  However, when `xml_parser_free()` is called multiple times on the
same XML parser resource, the resource would be freed prematurely.

Instead we forcefully close the resource in `xml_parser_free()`.  We
also could decrease the refcount of the resource there, but that would
require to call `xml_parser_free()` which is somewhat uncommon, and
would be particularly bad wrt. PHP 8 where that function is a NOP, and
as such doesn't have to be called.  So we do no longer increase the
refcount of the resource when copying it to the internal zval, and let
the usualy refcounting semantics take care of the resource destruction.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=4a42fbbbc73aad7427aef5c89974d1833636e082>
2020-08-10 12:23:44 +02:00
Nikita Popov
2d087210eb Fixed bug #79947
Move the FREE_OP for op_data out of the zend_binary_assign_op_dim_slow()
slow path, so it can be used by the other error path as well. This
makes ASSIGN_DIM_OP structurally more similar to ASSIGN_DIM.
2020-08-10 10:11:56 +02:00
Nikita Popov
fab2c3ba86 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #70574: Move files to proper locale dir
2020-08-07 14:37:43 +02:00
Florian Engelhardt
5be670265b Fix bug #70574: Move files to proper locale dir
Closes GH-5940.
2020-08-07 14:37:27 +02:00
Nikita Popov
2cbc94097e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79934: CRLF-only line in heredoc causes parsing error
2020-08-06 12:03:57 +02:00
Pieter van den Ham
06ade15528 Fix #79934: CRLF-only line in heredoc causes parsing error
Fixes the function `next_newline()` in zend_language_scanner.l. The
function now correctly returns a newline_len of 2 for "\r\n".

Closes GH-5944.
2020-08-06 12:02:54 +02:00
Nikita Popov
6bf8ff6d97 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79930
2020-08-05 15:44:00 +02:00
Nikita Popov
da786a22af Fixed bug #79930
We're inserting src_zval, so that's what we should addref.
2020-08-05 15:43:41 +02:00
Christoph M. Becker
c4677af67e [ci skip] Fix 7.3.21 release date 2020-08-04 12:31:24 +02:00
Christoph M. Becker
6f0c3386d4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Add missing NEWS entries
2020-08-03 11:19:44 +02:00
Christoph M. Becker
17d64af186 [ci skip] Add missing NEWS entries 2020-08-03 11:18:18 +02:00
Christoph M. Becker
fce8061ede Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79919: Stack use-after-scope in define()
2020-07-31 10:57:02 +02:00
Christoph M. Becker
1e0bc6e30f Fix #79919: Stack use-after-scope in define()
Instead of the temporary `rv`, we use the `val_free` which is there for
this purpose.
2020-07-31 10:54:41 +02:00
Christoph M. Becker
2bcc419800 Fix #73060: php failed with error after temp folder cleaned up
Instead of storing the mapping base address and the address of
`execute_ex()` in a separate file in the temporary folder, we store
them right at the beginning of the memory mapping.
2020-07-29 18:21:05 +02:00
Christoph M. Becker
826b90a5f0 Revert "Merge branch 'PHP-7.3' into PHP-7.4"
This reverts commit e1f6ab3388, reversing
changes made to e0ebe56ebf.

There are obviously issues with running tests in parallel, maybe
related to the cache ID.  This needs to be investigated.  Revert for
now.
2020-07-29 13:32:59 +02:00
Nikita Popov
678f5b6068 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79895: support = in PHP_CHECK_GCC_ARG m4 macro
2020-07-29 12:39:30 +02:00
Santiago M. Mola
e767ca60a0 Fix #79895: support = in PHP_CHECK_GCC_ARG m4 macro
Closes GH-5890.
2020-07-29 12:36:52 +02:00
Christoph M. Becker
e1f6ab3388 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #73060: php failed with error after temp folder cleaned up
2020-07-29 10:11:29 +02:00
Christoph M. Becker
9a744c66e7 Fix #73060: php failed with error after temp folder cleaned up
Instead of storing the mapping base address and the address of
`execute_ex()` in a separate file in the temporary folder, we store
them right at the beginning of the memory mapping.
2020-07-29 10:07:23 +02:00
Christoph M. Becker
e0ebe56ebf Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79806: realpath() erroneously resolves link to link
2020-07-28 14:00:52 +02:00
Christoph M. Becker
c756f82c02 Fix #79806: realpath() erroneously resolves link to link
After resolving reparse points, the path still may be a reparse point;
in that case we have to resolve that reparse point as well.
2020-07-28 13:55:22 +02:00
Côme Chilliet
1ba88355d7 Updated NEWS 2020-07-28 10:28:31 +02:00
Paweł Tomulik
efe6d96b45 fix memory leaks in ext/ldap/ldap.c 2020-07-28 10:23:10 +02:00
Christoph M. Becker
f02507469d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Revert "Fix #79806: realpath() erroneously resolves link to link"
2020-07-27 17:51:56 +02:00
Christoph M. Becker
1aeff522b8 Revert "Fix #79806: realpath() erroneously resolves link to link"
This reverts commit d5b59b4303.
2020-07-27 17:50:41 +02:00
Christoph M. Becker
85a26fef11 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79806: realpath() erroneously resolves link to link
2020-07-27 15:10:22 +02:00
Christoph M. Becker
d5b59b4303 Fix #79806: realpath() erroneously resolves link to link
After resolving reparse points, the path still may be a reparse point;
in that case we have to resolve that reparse point as well.
2020-07-27 15:08:39 +02:00
Christoph M. Becker
68aa1329eb Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77932: File extensions are case-sensitive
2020-07-27 11:54:54 +02:00
Christoph M. Becker
6f18d7e2f9 Fix #77932: File extensions are case-sensitive
The file extension to mime type mapping *must* not depend on the file
extension's case for case-insensitive file systems, and *should* not
for case-sensitive file systems.
2020-07-27 11:52:18 +02:00
Christoph M. Becker
3deb6b555a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79884: PHP_CONFIG_FILE_PATH is meaningless
2020-07-23 15:41:20 +02:00
Christoph M. Becker
15efb96d4c Fix #79884: PHP_CONFIG_FILE_PATH is meaningless
It does not make sense to make assumptions about `PHP_CONFIG_FILE_PATH`
during build time, since that value is never used during run time on
Windows.  Since there is no `--with-config-file-path` on Windows
either, we define `PHP_CONFIG_FILE_PATH` as `""`.
2020-07-23 15:39:22 +02:00
Nikita Popov
657a832a77 Fixed bug #79881 2020-07-22 10:21:24 +02:00
Derick Rethans
973be68c63 Prepare for 7.4.10 2020-07-21 09:23:51 +01:00
Christoph M. Becker
2c0a6977dd 7.3 is now 7.3.22-dev 2020-07-21 09:18:07 +02:00
Christoph M. Becker
4b96a75ffd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #63527: DCOM does not work with Username, Password parameter
2020-07-20 14:44:18 +02:00
Christoph M. Becker
b2e3fd1e69 Fix #63527: DCOM does not work with Username, Password parameter
We must not mix multibyte and wide character strings in the
`COAUTHIDENTITY` structure.  Using wide character strings throughout
would have the advantage that the remote connection can be established
regardless of the code page of the server, but that would more likely
break BC, so we just drop the wide character string conversion of the
username.
2020-07-20 14:43:29 +02:00
Nikita Popov
0c28b47154 Fixed bug #79839
Add reference type sources in array_walk.
2020-07-17 14:50:22 +02:00
Remi Collet
6ffe08d131 #79657 was cherry-picked in 7.4.7 2020-07-16 12:05:45 +02:00
Nikita Popov
2053329b1a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78008: dns_check_record() always return true on Alpine
2020-07-15 15:10:40 +02:00
Andy Postnikov
2c57378bd3 Fix bug #78008: dns_check_record() always return true on Alpine
- free handle before return result
- cleaned up remaining usage of MAXPACKET
- update dns_get_mx() to use the same approach

Closes GH-5854.
2020-07-15 15:10:19 +02:00
Nikita Popov
e8430b592f Fixed bug #79862
While normally a private property in the active scope would take
priority, we should not use this if it has the wrong "staticness".
2020-07-15 14:59:55 +02:00
Christopher Broadbent
ee7c7a8e26 Fixed bug #79820
Similar to what is done for ReflectionType itself, copy the
type name stored inside ReflectionProperty. Also make sure the
type field is always initialized for dynamic properties.

This is a non-issue in PHP 8, because we store a pointer to the
property_info there, rather than a copy.
2020-07-15 10:58:56 +02:00
Nikita Popov
a72c53a070 Fixed bug #79817
Use *_IND macros in a few places in string.c.
2020-07-10 14:06:41 +02:00
Derick Rethans
972383fda4 Revert "Partial fixed bug #79649 (Altering disable_functions from module init corrupts memory)"
This reverts commit a297c09da5.
2020-07-09 09:50:25 +01:00
Nikita Popov
77a8a709da Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #79787
2020-07-08 11:22:18 +02:00
XXiang
3d5de7d746 Fix bug #79787
Closes GH-5807.
2020-07-08 11:20:58 +02:00
Nikita Popov
77acc8a069 Fixed bug #79793
Make sure the string key is not released while throwing the
undefined index warning.
2020-07-07 16:29:48 +02:00
Nikita Popov
62bec0e083 Fixed bug #79784
The fix here is essentially the same as for bug #78598, just for
the undefined variable notice, rather than the undefined index one.
2020-07-07 14:22:58 +02:00
Nikita Popov
220880ad2d Fixed bug #78598
When performing an RW modification of an array offset, the undefined
offset warning may call an error handler / OB callback, which may
destroy the array we're supposed to change. Detect this by temporarily
incrementing the reference count. If we find that the array has been
modified/destroyed in the meantime, we do nothing -- the execution
model here would be that the modification has happened on the destroyed
version of the array.
2020-07-07 12:13:58 +02:00
Nikita Popov
48a247178e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79792
2020-07-07 11:59:40 +02:00
Nikita Popov
64931fd3c4 Fixed bug #79792
We need to remove the iterators even if the array is empty (we
will not create one if the first place, but the array may become
empty after the fact).
2020-07-07 11:58:25 +02:00
Nikita Popov
6a9d934b2c Fixed bug #79779
ASSIGN_OBJ_REF was not handling in zend_wrong_string_offset.
2020-07-07 10:27:22 +02:00
Nikita Popov
d9b4974cbc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79778
2020-07-07 10:20:11 +02:00
Nikita Popov
b765f96f5f Fixed bug #79778
In the interest of avoiding side-effects during dumping, I'm
replacing the value with a <constant ast> string instead of
performing an update constant operation.
2020-07-07 10:19:39 +02:00
Nikita Popov
971e5c5186 Fixed bug #79783
Make sure we don't drop the by-reference check when passing the
result of a VM builtin function.
2020-07-07 09:56:14 +02:00
Christoph M. Becker
993b19ae69 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #70362: Can't copy() large 'data://' with open_basedir
2020-06-30 10:48:07 +02:00
Christoph M. Becker
7f3bc64287 Fix #70362: Can't copy() large 'data://' with open_basedir
open_basedir is only relevant for plain files, so there is no need to
check it for other URL wrappers.
2020-06-30 10:46:53 +02:00
Christoph M. Becker
4af69b8477 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #63208: BSTR to PHP string conversion not binary safe
2020-06-29 19:06:00 +02:00
Christoph M. Becker
a385cfa7ad Fix #63208: BSTR to PHP string conversion not binary safe
A `BSTR` is similar to a `zend_string`; it stores the length of the
string just before the actual string, and thus the string may contain
NUL bytes.  However, `php_com_olestring_to_string()` is supposed to
deal with arbitrary `OLECHAR*`s which may not be `BSTR`s, so we
introduce `php_com_bstr_to_string()` and use it for the only case where
we actually have to deal with `BSTR`s which may contain NUL bytes.

Contrary to `php_com_olestring_to_string()` we return a `zend_string`,
so we can save the re-allocation when converting to a `zval`.

We also cater to `php_com_string_to_olestring()` not being binary safe,
with basically the same fix we did for `php_com_olestring_to_string()`.
2020-06-29 19:05:02 +02:00
Christoph M. Becker
dfac28f8d8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79756: finfo_file crash (FILEINFO_MIME)
2020-06-29 17:46:46 +02:00
Christoph M. Becker
816b4c1235 Fix #79756: finfo_file crash (FILEINFO_MIME)
If `ctime` or `asctime` return `NULL`, we must not attempt to copy the
buffer, but rather return `NULL` as well.
2020-06-29 17:45:28 +02:00
Nikita Popov
43cd3f6814 Fixed bug #79741 2020-06-26 12:28:39 +02:00
Nikita Popov
c5caa05171 Fixed bug #79740 2020-06-26 10:31:55 +02:00
Nikita Popov
5435a4a9d4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79030 Use usec from apache request time
2020-06-24 14:43:02 +02:00
Herbert256
4a26628b29 Fixed bug #79030 Use usec from apache request time
Don't unnecessarily truncate to milliseconds.

Closes GH-5760.
2020-06-24 14:41:50 +02:00
Christoph M. Becker
26aefb750a Fix #69804: ::getStaticPropertyValue() throws on protected props
`ReflectionClass` allows reading of the values of private and protected
constants, and also to get private and protected static methods.
Therefore getting the values of private and protected static properties
is also permissible, especially since `::getStaticProperties()` already
allows to do so.

We also allow ::setStaticPropertyValue() to modify private and
protected properties, because otherwise this method is useless, as
modifying public properties can be done directly.
2020-06-24 11:17:36 +02:00
Christoph M. Becker
ef2130db88 Fix #79487: ::getStaticProperties() ignores property modifications
When retrieving the static class properties via reflection, we have to
cater to possible modifications.
2020-06-24 10:05:51 +02:00
Christoph M. Becker
f3cccfde9e Revert "Fix #79487: ::getStaticProperties() ignores property modifications"
This reverts commit a895bb6885.
2020-06-23 19:28:51 +02:00
Christoph M. Becker
a895bb6885 Fix #79487: ::getStaticProperties() ignores property modifications
When retrieving the static class properties via reflection, we have to
cater to possible modifications.
2020-06-23 18:48:54 +02:00
Christoph M. Becker
e7bbac9d11 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #55857: ftp_size on large files
2020-06-23 16:00:11 +02:00
Christoph M. Becker
e94126aac7 Fix #55857: ftp_size on large files
`atol()` returns a `long` which is not the same as `zend_long` on
LLP64; we use `ZEND_ATOL()` instead.

There is no need for a new test case, since filesize_large.phpt already
tests for that behavior; unfortunately, the FTP test suite relies on
`pcntl_fork()` and therefore cannot be run on Windows.
2020-06-23 15:57:24 +02:00
Christoph M. Becker
91982bad63 7.3 is now 7.3.21-dev 2020-06-23 10:29:42 +02:00
Nikita Popov
525d8a8bfa Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79570
2020-06-19 17:32:21 +02:00
Böszörményi Zoltán
6aff9a50ca Fixed bug #79570
Use the same logic for getgrgid_r, getpwnam_r and getpwuid_r
as for getgrnam_r in #75696

Closes GH-5740.
2020-06-19 17:31:28 +02:00
Nikita Popov
2f56b0018e Merge branch 'PHP-7.3' into PHP-7.4 2020-06-19 10:47:01 +02:00
Nikita Popov
32f377b0b9 Fixed bug #79710
Make sure we don't use zresource after the stream has been destroyed.
2020-06-19 10:46:26 +02:00
Christoph M. Becker
acdd6e597d Add missing NEWS entry
I forgot to update NEWS after merging back then.
2020-06-18 15:28:19 +02:00
Christoph M. Becker
59e343c779 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes
2020-06-13 18:32:15 +02:00
Christoph M. Becker
5621c5faf8 Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes
Even if the length of a maker note does not match our expectations
(either because the maker note is corrupted, or because our
expectations do not quite match reality), there is no need to let
parsing fail; we can still go on parsing the other meta information.
2020-06-13 18:30:57 +02:00
Christoph M. Becker
ff7fd3dc85 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79676: imagescale adds black border with IMG_BICUBIC
2020-06-12 14:07:43 +02:00
Christoph M. Becker
86e1f0ea11 Fix #79676: imagescale adds black border with IMG_BICUBIC
We have to loop over all image pixels to avoid the black border.  This
is also done in external libgd in `_gdScaleOneAxis` and `_gdScalePass`.
2020-06-12 14:05:54 +02:00
Christoph M. Becker
2a6f2d82e1 Update NEWS wrt. bug 79681 2020-06-10 16:44:17 +02:00
Xinchen Hui
a297c09da5 Partial fixed bug #79649 (Altering disable_functions from module init corrupts memory)
In module startup stage, we should not initiliaze
EG(modified_ini_directives) as it use zend MM, the zend MM will be
restart at the end of modules startup stage,

by say "partial", because this issue still exists if altering ZEND_USER
inis, we should add a zend_ini_deactive at the end of modules startup
stage, but it brings some new cost, and I think no one would do things
like that
2020-06-10 11:16:42 +08:00
Christoph M. Becker
3c12c41927 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix possibly unsupported timercmp() usage
2020-06-09 16:54:43 +02:00
Christoph M. Becker
7ac0fb5ae4 Fix possibly unsupported timercmp() usage
The `timercmp()` manpage[1] points out that some systems have a broken
implementation which does not support `>=`.  This is definitely the
case for the Windows SDK, which only supports `<` and `>`.

[1] <https://linux.die.net/man/3/timercmp>
2020-06-09 16:52:19 +02:00
Christoph M. Becker
85657b486f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #62890: default_socket_timeout=-1 causes connection to timeout
2020-06-09 16:47:00 +02:00
Christoph M. Becker
eadd980706 Fix #62890: default_socket_timeout=-1 causes connection to timeout
While unencrypted connections ignore negative timeouts, SSL/TLS
connections did not special case that, and so always failed due to
timeout.
2020-06-09 16:45:34 +02:00
Christoph M. Becker
eac700b1e6 [ci skip] Update NEWS 2020-06-09 16:37:17 +02:00
Nikita Popov
2447fd9f84 Fixed bug #79683
Reset fake_scope during __toString() call.

I'll check if we can solve this more globally in master, by
resetting fake_scope in zend_call_function.
2020-06-09 15:51:05 +02:00
Christoph M. Becker
ee4683cf28 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #74267: segfault with streams and invalid data
2020-06-08 23:22:49 +02:00
Christoph M. Becker
12c59f6660 Fix #74267: segfault with streams and invalid data
If the current character is a line break character, it cannot be a tab
or space character, so we would always fail with an invalid sequence
error.  Obviously, these `scan_stat == 4` conditions are meant to be
exclusive.

Furthermore, if `in_pp == NULL || in_left_p == NULL` is true, we hit a
segfault if we are not returning right away.  Obviously, the additional
constraints don't make sense, so we remove them.
2020-06-08 23:19:43 +02:00
Nikita Popov
df2db7fcea Fixed bug #79657
Throwing an exception should count as an initialization for this
purpose.
2020-06-08 11:31:28 +02:00
Christoph M. Becker
d65c85366d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #73527: Invalid memory access in php_filter_strip
2020-06-04 13:38:45 +02:00
Christoph M. Becker
ceae81665c Fix #73527: Invalid memory access in php_filter_strip 2020-06-04 13:37:11 +02:00
Christoph M. Becker
5e38a1b352 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79668: get_defined_functions(true) may miss functions
2020-06-04 09:00:01 +02:00
Christoph M. Becker
b8e7b30b47 Fix #79668: get_defined_functions(true) may miss functions
Instead of some brittle and unefficient string matching, we can just
check for the function handler.
2020-06-04 08:45:27 +02:00
Christoph M. Becker
af4a9bf1bf Fix #73927: phpdbg fails with windows error prompt at "watch array"
We expect zvals, so we should request zvals.

We also suppress spurious watchpoint removal notices.
2020-06-02 15:17:40 +02:00
Christoph M. Becker
461135009c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79664: PDOStatement::getColumnMeta fails on empty result set
2020-06-02 10:47:10 +02:00
Christoph M. Becker
63bd8f38f4 Fix #79664: PDOStatement::getColumnMeta fails on empty result set
As its name suggests, `sqlite3_data_count` returns the number of
columns in the current row of the result set; we are interested in the
number of columns regardless of the current row, so we have to use
`sqlite3_column_count` instead.
2020-06-02 10:45:47 +02:00
Christoph M. Becker
b26ad33001 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79650: php-win.exe 100% cpu lockup
2020-06-01 13:24:32 +02:00
Christoph M. Becker
923c45bdca Fix #79650: php-win.exe 100% cpu lockup
As of PHP 7.3.0, `sapi_cli_single_write()` is supposed to return `< 0`
on failure, but `fwrite()` returns a `size_t`, and signals error by
setting the stream's error indicator.  We have to cater to that.
2020-06-01 13:22:44 +02:00
Christoph M. Becker
8483a21f29 Fix several mostly Windows related phpdbg bugs
* Properly initialize PHPDBG_G(watch_tmp)

  Otherwise that may cause segfaults in ZTS builds.

* Deactivate potentially remaining watchpoints after REPL

  Otherwise the memory could still be protected, resulting in segfaults
  during shutdown.

* NULL zend_handlers_table after freeing

  As of commit 4130fe4[1], the `zend_handlers_table` is explicitly
  freed in the `zend_vm_dtor()`.  Since phpdbg (and maybe some other
  SAPIs) may restart the engine afterwards, we have to make sure that
  the table is also NULLed.

* Only set context option if there is a context

  In other words, we must not follow the null pointer.

* Cater to file handles without attached console

  File handles do not necessarily have an attached console (for
  instance, pipes do not), in which case `GetConsoleScreenBufferInfo()`
  fails.  In this case we set a default value (`40`) for lines like on
  other systems.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=4130fe437a5db7ead1444d3748bd0fbad9829cb2>
2020-05-26 17:45:25 +02:00
Christoph M. Becker
e483761a1e Fix #73926: phpdbg will not accept input on restart execution
We are more liberal, and accept Windows line endings (CRLF) as well.
2020-05-26 17:44:39 +02:00
Christoph M. Becker
879004dae3 Fix #79595: zend_init_fpu() alters FPU precision
On startup, PHP deliberately changes the floating point control word to
enforce binary64 format for the calculations for best consistency
across platforms.  However, this is unnessary for x86_64 architectures,
because in this case SSE instructions are used by default, and there is
no good reason to pass `-mfpmath=i387` or such.

Therefore, we can skip the modification, which has the benefit that
system libraries are free to work in the mode of their liking.
2020-05-26 17:19:54 +02:00
Derick Rethans
c6fc400e8b Add (expected) release date, and new header for 7.4.8 2020-05-26 14:20:06 +01:00
Derick Rethans
46d88a49cc This bug fix was cherry picked into 7.4.6 2020-05-26 14:19:13 +01:00
Derick Rethans
fb370ecbe5 Fixed historical dates in NEWS 2020-05-26 11:47:26 +01:00
Christoph M. Becker
c249f593ef 7.3.20 will be next 2020-05-26 10:53:22 +02:00
Nikita Popov
10eb842a64 Revert "Fix #79595: zend_init_fpu() alters FPU precision"
This reverts commit 88dfc475c5.
2020-05-22 16:57:14 +02:00
Christoph M. Becker
88dfc475c5 Fix #79595: zend_init_fpu() alters FPU precision
On startup, PHP deliberately changes the floating point control word to
enforce binary64 format for the calculations for best consistency
across platforms.  However, this is unnessary when compiling under
`__SSE__`, because in this case the x87 instructions are not used.
Therefore, we can skip the modification, which has the benefit that
system libraries are free to work in the mode of their liking.
2020-05-22 15:46:13 +02:00
Christoph M. Becker
da801ba5e3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79615: Wrong GIF header written in GD GIFEncode
2020-05-22 09:19:05 +02:00
Christoph M. Becker
d4bd6fb491 Fix #79615: Wrong GIF header written in GD GIFEncode
The color resolution is expected in bits 4-6 of the packed fields byte
of the logical screen descriptor (byte 10 of the GIF data stream),
according to the specification[1], section 18.

[1] <https://www.w3.org/Graphics/GIF/spec-gif89a.txt>
2020-05-22 09:15:41 +02:00
Nikita Popov
4f47ba99f0 Fix bug #79603, by retrying on RTD key collision
This is a non-intrusive fix for 7.4, still trying to find a good
solution for master.

Closes GH-5597.
2020-05-20 11:22:50 +02:00
Nikita Popov
d87b0685b5 Fixed bug #79600
Missed unsetting of DO_INIT in one case.
2020-05-15 11:04:40 +02:00
Xinchen Hui
3a3241ced7 fixed typo of bug id (#79599) 2020-05-15 15:43:38 +08:00
Xinchen Hui
ccd41e0833 Fixed bug #97599 (coredump in set_error_handler) 2020-05-15 15:36:00 +08:00
Christoph M. Becker
d1cd489a53 Fix #79596: MySQL FLOAT truncates to int some locales
We must not do locale aware float to string conversion here; instead
we using our `snprintf()` implementation with the `F` specifier.
2020-05-15 09:09:41 +02:00
Christoph M. Becker
129fd647a1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79588: Boolean opcache settings ignore on/off values
2020-05-12 19:48:12 +02:00
Christoph M. Becker
5bdb4ab786 Fix #79588: Boolean opcache settings ignore on/off values
We should display boolean INI settings as boolean.
2020-05-12 19:44:39 +02:00
Christoph M. Becker
4b0d5e0faf Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79489: .user.ini does not inherit
2020-05-12 11:48:36 +02:00
Christoph M. Becker
bdba0cd3d2 Fix #79489: .user.ini does not inherit
On Windows, PATH_TRANSLATED may contain backslashes as well as slashes,
so we must not only check for `DEFAULT_SLASH`.
2020-05-12 11:47:47 +02:00
Christoph M. Becker
85e241c35c [ci skip] Update NEWS 2020-05-12 11:16:55 +02:00
Christoph M. Becker
d5300873c5 Fix #79571: FFI: var_dumping unions may segfault
We must not attempt to access arbitrary union members when retrieving
debug info, because that may not be valid.  Therefore we do no longer
dereference pointer types inside of unions, but report their address as
string in `%p` format instead.
2020-05-11 16:24:46 +02:00
Christoph M. Becker
80b5006196 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79566: Private SHM is not private on Windows
2020-05-05 11:41:04 +02:00
Christoph M. Becker
f33cf52faf Fix #79566: Private SHM is not private on Windows
We map the POSIX semantics of `IPC_PRIVATE` by creating unnamed file
mapping objects on Windows.  While that is not particularly useful for
ext/shmop, which is the only bundled extension which uses `shmget()`,
it may be useful for external extensions.
2020-05-05 11:38:29 +02:00
Christoph M. Becker
ed6bf0bc69 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79561: dns_get_record() fails with DNS_ALL
2020-05-04 23:00:56 +02:00
Christoph M. Becker
c40a494406 Fix #79561: dns_get_record() fails with DNS_ALL
Since Windows has its own definitions of the `PHP_DNS_*` macros, we
have to use these when registering the PHP constants.
2020-05-04 22:59:38 +02:00
Nikita Popov
7c1316ec6a Fixed bug #79535
We did not allocate a cache slot for FETCH_CLASS. This is already
fixed on newer PHP versions.
2020-05-04 14:51:18 +02:00
Christoph M. Becker
9b9252c667 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4
2020-05-01 12:40:37 +02:00
Christoph M. Becker
54148fd686 Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4
Revert "Fix #61597: SXE properties may lack attributes and content"

This reverts commit 7c081db885.
2020-05-01 12:37:39 +02:00
Xinchen Hui
8555c2bff0 Fixed bug #79536 (zend_clear_exception prevent exception's destructor to be called). 2020-04-29 18:58:28 +08:00
Christoph M. Becker
6998cc5029 Bump version 2020-04-28 09:10:50 +02:00
Christoph M. Becker
29968d8f99 Fix #79470: PHP incompatible with 3rd party file system on demand
We add support for Activision HSM (`IO_REPARSE_TAG_ACTIVISION_HSM`) and
VFS for Git (`IO_REPARSE_TAG_PROJFS`).  The latter fixes bug #78784.
2020-04-27 09:30:57 +02:00
Christoph M. Becker
3151676f52 Fix #79514: Memory leaks while including unexistent file
We have to destroy (un-opened) ZEND_HANDLE_FILENAMEs.
2020-04-24 18:14:53 +02:00
Nicolas Grekas
73d02c3b3e Fix bug #79447
Partially reverts 846b647953: instead of
throwing, this skips uninitialized typed properties when serializing objects.

This makes serialize with __sleep() behave the same as serialize()
without __sleep().

As in the non-__sleep() case, unserialize(serialize($x)) identity
may not be preserved due to replacement of uninitialized/unset
properties with default values. Fixing this will require changes to
the serialization format.

Closes GH-5396.
2020-04-23 10:30:33 +02:00
Christoph M. Becker
c705079b12 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79503: Memory leak on duplicate metadata
2020-04-22 15:08:50 +02:00
Christoph M. Becker
ccca2c448d Fix #79503: Memory leak on duplicate metadata
Duplicate metadata can only happen if someone tampers with the phar, so
we can and should treat that as error.
2020-04-22 15:07:46 +02:00
Christoph M. Becker
225117af71 Upgrade to PCRE2 10.34
We backport the slightly modified variant from master.
2020-04-22 14:23:26 +02:00
Alex Dowad
0d11d37357 Fix bug #67369 ArrayObject serializatino drops the iterator class
When ArrayObject is round-tripped through serialize() and unserialize(),
it forgets any iterator class name which was set using ::setIteratorClass().
Fix that.
2020-04-20 11:55:18 +02:00
Christoph M. Becker
18ad38a7b2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79491: Search for .user.ini extends up to root dir
2020-04-20 10:58:33 +02:00
Christoph M. Becker
fa10abd6d7 Fix #79491: Search for .user.ini extends up to root dir
The `start` parameter of `php_cgi_ini_activate_user_config` is supposed
to hold the byte offset of the doc root in the given `path`.  However,
the current expression which fixes a potential type incompatibility
will ever only evaluate to zero or one, because it uses the *logical*
and operator (`&&`).  Furthermore we notice that subtracting one from
`doc_root_len` is not necessary, so there is even no need for the
`start` parameter at all.
2020-04-20 10:56:36 +02:00
Nikita Popov
a230b5a6c9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79497: Fix php_openssl_subtract_timeval()
2020-04-20 10:26:22 +02:00
Joe Cai
94e09bfe55 Fix #79497: Fix php_openssl_subtract_timeval()
I stumbled upon this while debugging a strange issue with
stream_socket_client() where it randomly throws out errors when
the connection timeout is set to below 1s. The logic to calculate
time difference in php_openssl_subtract_timeval() is wrong when
a.tv_usec < b.tv_usec, causing connection errors before the timeout
is reached.
2020-04-20 10:25:54 +02:00
Nikita Popov
0b709e3409 Fix bug #79336
Make reading of floats and doubles host-endian independent.
2020-04-16 12:18:41 +02:00
Nikita Popov
58e6a0a602 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79477
2020-04-15 11:21:42 +02:00
Nikita Popov
79a36ff7f3 Fixed bug #79477
Make sure to deindirect properties when creating array.
2020-04-15 11:21:05 +02:00
Christoph M. Becker
537680a9c4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add missing CVE
2020-04-14 18:19:34 +02:00
Christoph M. Becker
c4cdf1ae12 Add missing CVE 2020-04-14 18:18:18 +02:00
Nikita Popov
ef56b2c977 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79468
2020-04-14 12:01:51 +02:00
dinosaur
95eaccd0bb Fixed bug #79468
Close the stream filter resources when removing them from the stream.
2020-04-14 11:59:51 +02:00
Christoph M. Becker
a76b3358e4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add NEWS entries [ci skip]
2020-04-14 08:56:09 +02:00
Christoph M. Becker
8967588702 Add NEWS entries [ci skip] 2020-04-14 08:54:00 +02:00
Nikita Popov
823a956855 Fixed bug #78434
The DO_INIT flag, which will skip the first resume on a primed
generator, should always be set when starting to yield from a
new generator, not only when the yield from happens during priming.
2020-04-09 10:33:11 +02:00
Christoph M. Becker
13c9572a79 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78221: DOMNode::normalize() doesn't remove empty text nodes
2020-04-07 13:07:33 +02:00
Christoph M. Becker
efec22b7be Fix #78221: DOMNode::normalize() doesn't remove empty text nodes
If a text node is not followed by another text node, we remove it, if
its textContent is empty.
2020-04-07 13:04:14 +02:00
Christoph M. Becker
22a077b642 Fix #69264: __debugInfo() ignored while extending SPL classes
We actually implement `::__debugInfo()` and drop the `get_debug_info()`
handlers of all relevant SPL classes.  This is cleaner and gives more
flexibility regarding overriding the functionality in descendant
classes.
2020-04-06 12:01:29 +02:00
Nikita Popov
cf68bc413b Fixed bug #79434 2020-04-02 16:34:03 +02:00
Christoph M. Becker
c065a586d2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add NEWS entryc [ci skip]
2020-04-01 09:28:39 +02:00
Christoph M. Becker
cc3af6fdea Add NEWS entryc [ci skip] 2020-04-01 09:26:20 +02:00
Derick Rethans
01634f8410 The 7.4 branch is now for 7.4.6 2020-03-31 14:57:12 +01:00
Christoph M. Becker
33226c3a17 Next is 7.3.18 2020-03-31 10:22:55 +02:00
Christoph M. Becker
d533fa15e6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79413: session_create_id() fails for active sessions
2020-03-31 08:39:54 +02:00
Christoph M. Becker
b510250b8e Fix #79413: session_create_id() fails for active sessions
The comment on `PS_VALIDATE_SID_FUNC(files)` is very clear that the
function is supposed to return `SUCCESS` if the session already exists.
So to detect a collision, we have to check for `SUCCESS`, not
`FAILURE`.

We also fix the wrong condition in session_regenerate_id() as well.
2020-03-31 08:38:23 +02:00
Christoph M. Becker
a2f8c78183 Fix #74940: DateTimeZone loose comparison always true
Since `DateTimeZone` does not implement a `compare_objects` handler,
nor has any properties, two `DateTimeZone` instances always compare as
being equal, even if they designate totally different timezones.  Even
worse, after calling `var_dump()` on these objects, the actual
comparison may yield a correct result.

We therefore introduce a `compare_objects` handlers, which prevents
different behavior before/after `var_dump()`, and which allows us to
clearly define the intended semantics.
2020-03-30 09:03:40 +02:00
Christoph M. Becker
6f8045c47f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79427: Integer Overflow in shmop_open()
2020-03-30 08:57:49 +02:00
Christoph M. Becker
a681b12820 Fix #79427: Integer Overflow in shmop_open()
If `shm.shm_segsz > ZEND_LONG_MAX` the assignment to `shmop->size` a
few lines below would overflow, so we catch that early and bail out if
necessary.
2020-03-30 08:56:49 +02:00
Andre Nathan
0b4e80b8c1 Allow numeric [UG]ID in FPM listen.{owner,group} 2020-03-29 20:20:01 +01:00
Remi Collet
d66a063e0f NEWS 2020-03-29 14:23:28 +02:00
Max Rees
04920645f1 Fix #79424 ext/zip: don't use gl_pathc after call to globfree
This breaks on Linux with the musl libc, since it zeroes out gl_pathc during
globfree.
2020-03-29 14:22:31 +02:00
Dmitry Stogov
91ee85c20c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79412 (Opcache chokes and uses 100% CPU on specific script).
2020-03-25 17:31:33 +03:00
Dmitry Stogov
65120cfc09 Fixed bug #79412 (Opcache chokes and uses 100% CPU on specific script). 2020-03-25 17:31:06 +03:00
Nikita Popov
2b3b7f5cd9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #79410 (system() swallows last chunk if it is exactly 4095 bytes without newline)
2020-03-25 10:51:23 +01:00
Christian Schneider
c0840fec9c Fix bug #79410 (system() swallows last chunk if it is exactly 4095 bytes without newline)
Closes GH-5292.
2020-03-25 10:50:35 +01:00
Christoph M. Becker
a7bbfc95eb Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79200: Some iconv functions cut Windows-1258
2020-03-23 14:13:42 +01:00
Christoph M. Becker
32a2644305 Fix #79200: Some iconv functions cut Windows-1258
To cater to potentially state-dependent encodings, we have to reset the
conversion descriptor into its initial shift state to properly finish
the conversion.  Furthermore, state-dependent encodings may not show
progress when comparing `in_left` before and after the conversion; we
rather have to see whether `out_left` has decreased.  Also we have to
cater to the fact that the final potentially state resetting call does
not signal failure, but we still have to break respective loops
afterwards.
2020-03-23 14:12:37 +01:00
Christoph M. Becker
4576da0aa7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79393: Null coalescing operator failing with SplFixedArray
2020-03-23 13:31:25 +01:00
Christoph M. Becker
47c745555c Fix #79393: Null coalescing operator failing with SplFixedArray
We favor the KISS principle over optimization[1] – SPL is already
special enough.

[1] <352f3d4476 (r112498098)>ff
2020-03-23 13:29:25 +01:00
Remi Collet
6c0f9c3fc6 NEWS 2020-03-20 11:17:29 +01:00
Remi Collet
51c57a9c67 NEWS 2020-03-20 11:16:08 +01:00
Christoph M. Becker
1d9e716a47 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79396: DateTime hour incorrect during DST jump forward
2020-03-19 08:51:55 +01:00
Nate Brunette
d70058a139 Fix #79396: DateTime hour incorrect during DST jump forward
When you attempt to set the time to a non-existent time occuring during
a DST jump forward, the hour does not move forward correctly.
2020-03-19 08:50:34 +01:00
Christoph M. Becker
1e63900cc0 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix NEWS
2020-03-17 11:12:57 +01:00
Christoph M. Becker
9b8aa105ed Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix NEWS
2020-03-17 11:09:55 +01:00
Christoph M. Becker
6a4fff4682 Fix NEWS 2020-03-17 11:06:45 +01:00
Stanislav Malyshev
fc39bb9da9 [ci skip] Update NEWS 2020-03-16 22:40:48 -07:00
Stanislav Malyshev
e71fa03107 [ci skip] Update NEWS 2020-03-16 22:40:00 -07:00
Stanislav Malyshev
c8d21d7728 [ci skip] Update NEWS 2020-03-15 19:38:31 -07:00
Christoph M. Becker
ddc3f3d595 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79199: curl_copy_handle() memory leak
2020-03-12 11:27:45 +01:00
Christoph M. Becker
2b5fc8e325 Fix #79199: curl_copy_handle() memory leak
`curl_copy_handle()` already registers a new resource, so we must not
increase the refcount of the original resource.
2020-03-12 11:23:53 +01:00
Christoph M. Becker
2b56735ea0 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #61597: SXE properties may lack attributes and content
2020-03-12 10:56:13 +01:00
Christoph M. Becker
7c081db885 Fix #61597: SXE properties may lack attributes and content
We must not treat a node as string if it has attributes, unless it is
an entity declaration which is always treated as string by simplexml.
2020-03-12 10:52:28 +01:00
Christoph M. Becker
8657f03084 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78210: Invalid pointer address
2020-03-11 11:31:26 +01:00
Christoph M. Becker
53797c206a Fix #78210: Invalid pointer address
This is actually about three distinct issues:

* If an empty string is passed as $address to `stream_socket_sendto()`,
  the `sa` is not initialized, so we must not pass it as `addr` to
  `php_stream_xport_sendto()`.

* On POSIX, `recvfrom()` truncates messages which are too long to fit
  into the specified buffer (unless `MSG_PEEK` is given), discards the
  excessive bytes, and returns the buffer length.  On Windows, the same
  happens, but `recvfrom()` returns `SOCKET_ERROR` with the error code
  `WSAEMSGSIZE`.  We have to catch this for best POSIX compatibility.

* In `php_network_parse_network_address_with_port()`, we have to zero
  `in6` (not only its alias `sa`) to properly support IPv6.

Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
2020-03-11 11:30:15 +01:00
Christoph M. Becker
a72b261db5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79364: When copy empty array, next key is unspecified
2020-03-11 08:55:28 +01:00
Christoph M. Becker
2462f2dab1 Fix #79364: When copy empty array, next key is unspecified
We must not forget to keep the `nNextFreeElement` when duplicating
empty arrays.
2020-03-11 08:54:05 +01:00
Nikita Popov
760faa12b2 Fixed bug #79357
Peculiarly, for once the cause was not SOAPs "interesting" error
handling, but a bug in the call trampoline for internal functions...
2020-03-09 15:01:31 +01:00
Christoph M. Becker
b761997de3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #75673: SplStack::unserialize() behavior
2020-03-06 09:11:10 +01:00
Christoph M. Becker
b84277297a Fix #75673: SplStack::unserialize() behavior
Even though `SplStack::unserialize()` is not supposed to be called on
an already constructed instance, it is probably better if the method
clears the stack before actually unserializing.
2020-03-06 09:09:49 +01:00
Christoph M. Becker
9dda3b9eb2 Next is 7.3.17 2020-03-03 10:19:31 +01:00
Christoph M. Becker
fc8b3ab7cb Fix #79013: Content-Length missing when posting a curlFile with curl
Unfortunately, some Webservers (e.g. IIS) do not implement the (F)CGI
specifications correctly wrt. chunked uploads (i.e. Transfer-encoding:
chunked), but instead pass -1 as CONTENT_LENGTH to the CGI
application. However, our (F)CFI SAPIs (i.e. cgi and cgi-fcgi) do not
support this.

Therefore we try to retrieve the stream size in advance and pass it to
`curl_mime_data_cb()` to prevent libcurl from doing chunked uploads.
This is basically the same approach that `curl_mime_filedata()`
implements, except that we are keeping already opened streams open for
the `read_cb()`.
2020-03-02 19:11:33 +01:00
Christoph M. Becker
a0377021c5 Native Windows support for mysqlnd sha256 authentification
We implement that on top of Cryptography API: Next Generation (CNG).
2020-03-02 16:32:51 +01:00
Christoph M. Becker
318757551a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79333: com_print_typeinfo() leaks memory
2020-03-02 11:38:03 +01:00
Christoph M. Becker
53140e5c56 Fix #79333: com_print_typeinfo() leaks memory
We have to free the `ansiname`s, regardless of whether they have been
put into the hashtable or not.

Since bug79299.phpt already shows the leak when run with a leak
checker, there is no need for another regression test.
2020-03-02 11:36:30 +01:00
Christoph M. Becker
b9843c9418 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79332: php_istreams are never freed
2020-03-02 10:46:46 +01:00
Christoph M. Becker
2adf1c4d23 Fix #79332: php_istreams are never freed
Releasing the `com_dotnet_istream_wrapper` in `istream_destructor()` is
pointless, since `istream_destructor()` is only called when the
resource is going to be released.  This recursion is not a real issue,
though, since the resource is never exposed to userland, and has at
most refcount 1, so due to well defined unsigned integer underflow, it
never is released twice.  However, returning early in this case causes
a memory leak which needs to be fixed.
2020-03-02 10:45:37 +01:00
Nikita Popov
375191aae7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79062
2020-02-28 17:07:36 +01:00
Nikita Popov
6c48da9a50 Fixed bug #79062
Back up the doc comment when performing heredoc scanahead.
2020-02-28 17:06:05 +01:00
Christoph M. Becker
0bffee4a35 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79311: enchant_dict_suggest() fails on big endian architecture
2020-02-28 15:44:52 +01:00
Christoph M. Becker
6adb885966 Fix #79311: enchant_dict_suggest() fails on big endian architecture
For obvious reasons, we must not assign a `size_t` value to an `int`
variable using memcpy().  However, there is actually no need for the
intermediate `n_sugg_st` here, if we use the proper types in the first
place.

A regression test is not necessary, because dict_suggest.phpt already
exhibits the erroneous behavior on big endian architectures.
2020-02-28 15:43:44 +01:00
Nikita Popov
30ee3f48d4 Fixed bug #79252 2020-02-28 12:47:56 +01:00
Remi Collet
1b40bb76b9 NEWS 2020-02-28 10:36:12 +01:00
Christoph M. Becker
78e04759ad Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #64032: mysqli reports different client_version
2020-02-27 09:39:13 +01:00
Christoph M. Becker
8654c32b58 Fix #64032: mysqli reports different client_version
While `mysqli_get_client_version()` calls `mysql_get_client_version()`
to retrieve the client version, `mysql::$client_version` is initialized
to `MYSQL_VERSION_ID`.  Both should match though, and since the former
is the more useful information, we fix `mysql::$client_version`.

We do not add a regression test, because it would usually succeed
anyway, and we already have several tests with respective `assert()`s.
2020-02-27 09:35:04 +01:00