Commit Graph

13196 Commits

Author SHA1 Message Date
Christoph M. Becker
35e1f134f5
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #53580: During resize gdImageCopyResampled cause colors change
2021-08-26 18:41:08 +02:00
Christoph M. Becker
526407ca35
Fix #53580: During resize gdImageCopyResampled cause colors change
We port the upstream fix[1], and also revert commit a3383ac3d7[2] which
is now obsolete, and also not part of libgd.  Especially the change to
gd.png.c was at best a half-baked optimization.

[1] <a24e96f019>
[2] <a3383ac3d7>

Closes GH-7402.
2021-08-26 18:38:17 +02:00
Christoph M. Becker
465b3ab2f9
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #78819: Heap Overflow in msg_send
2021-08-18 16:37:58 +02:00
Christoph M. Becker
9494b1cdc4
Fix #78819: Heap Overflow in msg_send
We need to use the proper type.

Closes GH-7386.
2021-08-18 16:35:16 +02:00
Christoph M. Becker
d71a0dcc76
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #73122: Integer Overflow when concatenating strings
2021-08-18 14:52:59 +02:00
Christoph M. Becker
0b7dffb41f
Fix #73122: Integer Overflow when concatenating strings
We must avoid integer overflows in memory allocations, so we introduce
an additional check in the VM, and bail out in the rare case of an
overflow.

Closes GH-7381.
2021-08-18 14:49:09 +02:00
Christoph M. Becker
e45a063f4b
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #71542: disk_total_space does not work with relative paths
2021-08-17 11:31:14 +02:00
Christoph M. Becker
f924e97269
Fix #71542: disk_total_space does not work with relative paths
For ZTS builds, we need to expand the path given to `disk_free_space()`
and `disk_total_space()` to properly support the VCWD.

Closes GH-7377.
2021-08-17 11:29:33 +02:00
Nikita Popov
47ccdecf00 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #81353
2021-08-16 15:04:57 +02:00
Nikita Popov
d1e956ff31 Fixed bug #81353
A user-defined error handler should not be invoked for preload
warnings. We are in a partially shut-down state at that point.
2021-08-16 15:04:17 +02:00
Christoph M. Becker
2c6177a4a8
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81351: xml_parse may fail, but has no error code
2021-08-13 17:37:36 +02:00
Christoph M. Becker
80a377e69b
Fix #81351: xml_parse may fail, but has no error code
The fix for bug #73151[1] cured the symptoms, but not the root cause,
namely xmlParse() must not be called recursively.  Since that bugfix
also messed up the error handling, we basically revert it (but also
simplify the return), and then prevent calling the parser recursively.

[1] <f2a8a8c068>

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

Closes GH-7363.
2021-08-13 17:33:58 +02:00
Christoph M. Becker
a2b92d6baa
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81346: Non-seekable streams don't update position after write
2021-08-10 16:50:36 +02:00
Christoph M. Becker
4a1af1f871
Fix #81346: Non-seekable streams don't update position after write
The stream position is not related to the buffer, and needs to be
updated for non-seekable streams as well.  The erroneous condition
around the position update is a relict of an old commit[1].

The unexpected test expectation is due to bug #81345.

[1] <088e2692c3>

Closes GH-7356.
2021-08-10 16:49:07 +02:00
Christoph M. Becker
2e71c94c9b
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81302: Stream position after stream filter removed
2021-08-10 16:41:14 +02:00
Christoph M. Becker
40b31fcc80
Fix #81302: Stream position after stream filter removed
When flushing the stream filters actually causes data to be written to
the stream, we need to update its position, because that is not done by
the streams' write methods.

Closes GH-7354.
2021-08-10 16:39:55 +02:00
Gabriel Caruso
00bb7c97f8
Prepare for PHP 8.0.11 2021-08-10 11:46:56 +02:00
Derick Rethans
79d564a8cc Prepare for 7.4.24 2021-08-10 10:14:36 +01:00
Christoph M. Becker
606829f31f
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #74544: Integer overflow in mysqli_real_escape_string()
2021-08-10 00:06:58 +02:00
Christoph M. Becker
5977610de1
Fix #74544: Integer overflow in mysqli_real_escape_string()
The patch has been provided by @johannes.

Closes GH-7353.
2021-08-10 00:05:39 +02:00
Derick Rethans
4aeff60f34 Upgrade timelib to version 2020.03 2021-08-08 12:11:18 +01:00
Christoph M. Becker
5628afb782
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81327: Error build openssl extension on php 7.4.22
2021-08-04 18:44:06 +02:00
Christoph M. Becker
6724d5d4c2
Fix #81327: Error build openssl extension on php 7.4.22
The recent fix for bug 52093 is not compatible with LibreSSL ≥ 2.7.0,
which we recognize as mostly OpenSSL 1.1.0 compatible, but they still
do not support `ASN1_INTEGER_set_int64()`.

Closes GH-7339.
2021-08-04 18:41:04 +02:00
Christoph M. Becker
213ad544e4
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #51498: imagefilledellipse does not work for large circles
2021-08-03 16:20:16 +02:00
Christoph M. Becker
c565555f03
Fix #51498: imagefilledellipse does not work for large circles
We backport the respective upstream fix[1].

[1] <ace7fd88dc>

Closes GH-7329.
2021-08-03 16:17:47 +02:00
Remi Collet
35c3e0b1a4
NEWS 2021-08-03 12:07:46 +02:00
Christoph M. Becker
4645a9d10f
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81305: Built-in Webserver Drops Requests With "Upgrade" Header
2021-07-29 13:28:52 +02:00
Christoph M. Becker
d1ccb5bd0c
Fix #81305: Built-in Webserver Drops Requests With "Upgrade" Header
While our HTTP parser supports upgrade requests, the code using it does
not.  Since upgrade requests are only valid for HTTP/1.1 and we neither
support any higher version, nor HTTPS yet, we do not exit early in case
of such requests, i.e. we ignore them, what is allowed by the specs.

We keep the supporting code in case we can meaningfully support upgrade
requests in the future.

Closes GH-7316.
2021-07-29 13:16:15 +02:00
Christoph M. Becker
3244e0785d
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81252: PDO_ODBC doesn't account for SQL_NO_TOTAL
2021-07-28 10:53:27 +02:00
Christoph M. Becker
98049e8b9a
Fix #81252: PDO_ODBC doesn't account for SQL_NO_TOTAL
If `P->len` is negative (not only when it is `SQL_NULL_DATA`), we must
not go on, because the following code can't deal with that.  This means
that the output parameter will be set to `NULL` without any indication
what went wrong, but it's still better than crashing.

Closes GH-7295.
2021-07-28 10:51:38 +02:00
Christoph M. Becker
bf9afc184f
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81294: Segfault when removing a filter
2021-07-27 12:14:22 +02:00
Christoph M. Becker
1fa26eccba
Fix #81294: Segfault when removing a filter
We need to call the proper method.

Closes GH-7308.
2021-07-27 12:12:02 +02:00
Christoph M. Becker
71879d385e
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81283: shmop can't read beyond 2147483647 bytes
2021-07-23 17:49:56 +02:00
Christoph M. Becker
387c0de983
Fix #81283: shmop can't read beyond 2147483647 bytes
`start`, `count` and `shmop->size` are `zend_long`, so we must not
restrict to `INT_MAX`.

Closes GH-7301.
2021-07-23 17:46:42 +02:00
Nikita Popov
90ee1c36d7 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #66719
2021-07-23 11:24:59 +02:00
Nikita Popov
dfd05da97f Fix bug #66719
While parent:: should inherit the called scope, it should only do
so if it is compatible. If there is no called scope, or it is not
a subtype of the scope, we should fall back to the scope.
2021-07-23 11:24:22 +02:00
Dmitry Stogov
053c56f52e Fixed bug #81226 (Integer overflow behavior is different with JIT enabled) 2021-07-21 19:28:43 +03:00
Christoph M. Becker
f03e7c845e
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #74960: Heap buffer overflow via str_repeat
2021-07-21 15:33:17 +02:00
Christoph M. Becker
760ff841a1
Fix #74960: Heap buffer overflow via str_repeat
Trying to allocate a `zend_string` with a length only slighty smaller
than `SIZE_MAX` causes an integer overflow, so callers may need to
check that explicitly.  To make that easy in a portable way, we
introduce `ZSTR_MAX_LEN`.

Closes GH-7294.
2021-07-21 15:31:37 +02:00
Dmitry Stogov
a9991fbf28 Fixed Bug #80959 (infinite loop in building cfg during JIT compilation) 2021-07-21 14:32:44 +03:00
Dmitry Stogov
02acc5ad3b Fixed Bug #81255 (Memory leak in PHPUnit with functional JIT) 2021-07-20 22:14:32 +03:00
Nikita Popov
051ff33660 Fix bug #81272: Fix func info for functions returning EMPTY_ARRAY
The empty array has refcount > 1, so we should indicate this in
func info. In most cases this renders the func info redundant,
so drop it entirely.
2021-07-20 14:40:17 +02:00
Christoph M. Becker
18abfcb306
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Revert "Fix #79908: json_encode encodes negative zero as int"
2021-07-20 00:28:27 +02:00
Christoph M. Becker
2d2c001ca5
Revert "Fix #79908: json_encode encodes negative zero as int"
This reverts commit 717f1ed5e4.
2021-07-20 00:25:50 +02:00
Christoph M. Becker
ef77d3c89f
Fix #81206: Multiple PHP processes crash with JIT enabled
We need to avoid resetting the JIT for all SAPIs, but we need to
initialize the JIT handlers even when only reattaching on Windows.

Closes GH-7208.
2021-07-19 23:45:37 +02:00
Dmitry Stogov
c0e4932816 Fixed bug #81249 (Intermittent property assignment failure with JIT enabled) 2021-07-19 12:11:09 +03:00
Dmitry Stogov
9cd437138e Fixed bug #81225 (Wrong result with pow operator with JIT enabled) 2021-07-19 10:39:52 +03:00
Christoph M. Becker
9fbcaa57aa
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #78238: BCMath returns "-0"
2021-07-16 15:56:15 +02:00
Christoph M. Becker
bcb89c75ec
Fix #78238: BCMath returns "-0"
There is no negative zero in the decimal system, so we must suppress
the sign.

Closes GH-7250.
2021-07-16 15:54:24 +02:00
Nikita Popov
12a858ac95 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #81265: getimagesize returns 0 for 256px ICO images
2021-07-16 10:07:26 +02:00