Commit Graph

13993 Commits

Author SHA1 Message Date
Niels Dossche
3a44c78f14 Fix null pointer dereference of param
When the validation logic for param->type was added, the logic did not
account for the case where param could be NULL. The existing code did
take that into account as can be seen in the `if (param)` check below.
Furthermore, phpdbg_set_breakpoint_expression even calls
phpdbg_create_conditional_break with param == NULL.

Fix it by placing the validation logic inside a NULL check.
2022-12-30 06:53:28 +00:00
Max Kellermann
e217138b40 ext/opcache/jit/zend_jit_trace: add missing lock for EXIT_INVALIDATE
Commit 6c25413183 added the flag ZEND_JIT_EXIT_INVALIDATE which
resets the trace handlers in zend_jit_trace_exit(), but forgot to
lock the shared memory section.

This could cause another worker process who still saw the
ZEND_JIT_TRACE_JITED flag to schedule ZEND_JIT_TRACE_STOP_LINK, but
when it arrived at the ZEND_JIT_DEBUG_TRACE_STOP, the handler was
already reverted by the first worker process and thus
zend_jit_find_trace() fails.

This in turn generated a bogus jump offset in the JITed code, crashing
the PHP process.
2022-12-29 12:20:56 +00:00
Max Kellermann
b26b758952 ext/opcache/jit: handle zend_jit_find_trace() failures
Commit 6c25413 added the flag ZEND_JIT_EXIT_INVALIDATE which resets
the trace handlers in zend_jit_trace_exit(), but forgot to consider
that on ZEND_JIT_TRACE_STOP_LINK, this changed handler gets passed to
zend_jit_find_trace(), causing it to fail, either by returning 0
(results in bogus data) or by aborting due to ZEND_UNREACHABLE().  In
either case, this crashes the PHP process.

I'm not quite sure how to fix this multi-threading problem properly;
my suggestion is to just fail the zend_jit_trace() call.  After all,
the whole ZEND_JIT_EXIT_INVALIDATE fix was about reloading modified
scripts, so there's probably no point in this pending zend_jit_trace()
call.
2022-12-26 21:17:19 +00:00
Jakub Zelenka
a3891d9d1a
Fix GH-9981: FPM does not reset fastcgi.error_header 2022-12-25 14:44:25 +00:00
Derick Rethans
29926c3262 Merge remote-tracking branch 'derickr/gh10072-execute-ex' into PHP-8.1 2022-12-23 16:36:31 +00:00
Niels Dossche
5f1311a92c Fix undefined behaviour in phpdbg_load_module_or_extension
If zend_register_module_ex were to return NULL, then module_entry will
be set to NULL, and the if's body will load module_entry->name. Since
module_entry is NULL, loading the name would cause a NULL pointer
dereference. However, since a NULL pointer dereference is undefined
behaviour, the compiler is free to remove the check.
Fix it by using *name instead of module_entry->name.

Closes GH-10157

Signed-off-by: George Peter Banyard <girgias@php.net>
2022-12-23 13:55:50 +00:00
Niels Dossche
c4487b7a12
Initialize ping_auto_globals_mask to prevent undefined behaviour
Closes GH-10121
2022-12-22 14:59:24 +01:00
Arnaud Le Blanc
6de376a2b4 [ci skip] NEWS 2022-12-21 14:55:21 +01:00
Derick Rethans
d19a70c9a0 Fix GH-9891: DateTime modify with unixtimestamp (@) must work like setTimestamp 2022-12-20 14:41:13 +00:00
Stanislav Malyshev
05c35137cd Add NEWS 2022-12-18 23:24:53 -07:00
Christoph M. Becker
b8ac2071b8
Fix GH-10112: LDAP\Connection::__construct() refers to ldap_create()
There is no `ldap_create()`, but rather `ldap_connect()`.

Closes GH-10115.
2022-12-16 14:36:30 +01:00
Tyson Andre
7a983e281c
Fix Windows shmget() wrt. IPC_PRIVATE
Fixes #9944

https://man7.org/linux/man-pages/man2/shmget.2.html notes

   The name choice IPC_PRIVATE was perhaps unfortunate, IPC_NEW
   would more clearly show its function.

Closes GH-9946.
2022-12-13 15:46:40 +01:00
Christoph M. Becker
aef7d810d3
Fix GH-9949: Partial content on incomplete POST request
`ap_get_brigade()` may fail for different reasons, and we must not
pretend that a partially read POST payload is fine; instead we report
a content length of zero what matches all other `read_post()` callbacks
of bundled SAPIs.

Closes GH-10059.
2022-12-13 15:21:42 +01:00
Ben Ramsey
696bb385df
PHP-8.1 is now for PHP 8.1.15-dev 2022-12-07 11:29:37 -06:00
Christoph M. Becker
2f6b9e6c63
Fix #81742: open_basedir bypass in SQLite3 by using file URI
A previous fix[1] was not sufficient to catch all potential file URIs,
because the patch did not cater to URL encoding.  Properly parsing and
decoding the URI may yield a different result than the handling of
SQLite3, so we play it safe, and reject any file URIs if open_basedir
is configured.

[1] <https://bugs.php.net/bug.php?id=77967>

Closes GH-10018.
2022-12-06 15:59:52 +01:00
George Peter Banyard
608ddb0321
Fix GH-10011 (Trampoline autoloader will get reregistered and cannot be unregistered)
There are two issues to resolve:
 1. The FCC is not refetch when trying to unregister a trampoline
 2. Comparing the function pointer of trampolines is meaningless as they are reallocated, thus we need to compare the name of the function

Found while working on GH-8294

Closes GH-10033
2022-12-02 12:47:25 +00:00
蝦米
93592ea743
Fix GH-9769: Misleading error message for unpacking of objects
Only arrays can be unpacked in constant expressions.

Closes GH-9776.
2022-12-02 13:10:59 +01:00
Derick Rethans
d021851171 Fixed GH-9699, GH-9866, and GH-9880 (problems with diff); and GH-9700 (greedy tzid parsing) 2022-11-30 15:47:43 +00:00
Christoph M. Becker
44377c3c70
Fix GH-9971: Incorrect NUMERIC value returned from PDO_Firebird
Dialect 1 databases store and transfer `NUMERIC(15,2)` values as
doubles, which we need to cater to in `firebird_stmt_get_col()` to
avoid `ZEND_ASSUME(0)` to ever be triggered, since that may result
in undefined behavior.

Since adding a regression test would require to create a dialect 1
database, we go without it.

Closes GH-10021.
2022-11-30 12:11:42 +01:00
Jakub Zelenka
500b28ad04
Fix GH-10000: Test failures when OpenSSL compiled with no-dsa 2022-11-25 14:02:03 +00:00
Arnaud Le Blanc
4987e65a70 [ci skip] NEWS 2022-11-25 14:07:30 +01:00
Jakub Zelenka
ce57221376 Fix GH-9064: PHP fails to build if openssl was built with no-ec 2022-11-25 12:49:12 +00:00
Jakub Zelenka
c9c1934ff0
Fix GH-8517: FPM child pointer can be potentially uninitialized
There might be a moment when the child log event is executed after
freeing a child. That could possibly happen if the child output is
triggered at the same as the terminating of the child. Then the output
event could be potentially processed after the terminating event which
would cause this kind of issue.

The issue might got more visible after introducing the log_stream on
a child because it is more likely that this cannot be dereferenced
after free. However it is very hard to reproduce this issue so there
is no test for this.

The fix basically prevents passing a child pointer and instead passes
the child PID and then looks the child up by the PID when it is being
processed. This is obviously slower but it is a safe way to do it and
the slow down should not be hopefully visible in a way that it would
overload a master process.
2022-11-23 11:25:51 +00:00
Jakub Zelenka
1767f32cb6
[ci skip] Fix NEWS FPM entries 2022-11-22 18:47:24 +00:00
Jakub Zelenka
5a4520bc2b
Fix bug #68207: Setting fastcgi.error_header can result in a WARNING 2022-11-22 18:17:16 +00:00
Jakub Zelenka
31b20f1737
Merge branch 'PHP-8.0' into PHP-8.1 2022-11-22 18:02:11 +00:00
Petr Sumbera
72da2b02e2
php-fpm: fix Solaris port events.mechanism
Closes GH-9959.
2022-11-22 18:01:15 +00:00
George Peter Banyard
6fbf81c674
Fix GH-9883 SplFileObject::__toString() reads next line
We need to overwrite the __toString magic method for SplFileObject, similarly to how DirectoryIterator overwrites it
Moreover, the custom cast handler is useless as we define __toString methods, so use the standard one instead.

Closes GH-9912
2022-11-22 12:21:14 +00:00
Christoph M. Becker
2d94ee5f20
Avoid undefined behavior in Windows ftok(3) emulation
`.nFileIndexHigh` is a unsigned 32bit number.  Casting that to `__int64`
and shifting left by 32bits triggers undefined behavior if the most
significant bit of `.nFileIndexHigh` is set.  We could avoid that by
casting to `(__uint64)`, but in that case the whole clause doesn't have
an effect anymore, so we drop it altogether.

Closes GH-9958.
2022-11-18 14:37:00 +01:00
Michael Voříšek
8d65c2fee5
Fix GH-9650: Can't initialize heap: [0x000001e7]
Closes GH-9721.
2022-11-17 14:16:10 +01:00
David Carlier
a4298c14c1 Fix GH-9932: Discards further characters for session name.
As those are converted, it s better to make aware of the code caller of the naming inadequacy.
Closes GH-9940.
2022-11-15 12:27:44 +00:00
Alex Dowad
1562ba5b71 [ci skip] NEWS 2022-11-13 14:40:45 +02:00
Arnaud Le Blanc
73583bb8c0 [ci skip] NEWS 2022-11-13 11:05:12 +01:00
Akama Hitoshi
af68beb16a
[ci skip] Fix GH-9918: License information for xxHash is not included in README.REDIST.BINS file
Closes GH-9919.
2022-11-10 12:37:08 +01:00
Christoph M. Becker
b2186ca7c4
Fix GH-9905: constant() behaves inconsistent when class is undefined
Directly referring to a constant of an undefined throws an exception;
there is not much point in `constant()` raising a fatal error in this
case.

Closes GH-9907.
2022-11-09 15:21:50 +01:00
Sara Golemon
ac508301c9
Bump for 8.0.27 2022-11-08 22:10:29 +00:00
Patrick Allaert
540488c74e
PHP-8.1 is now for PHP 8.1.14-dev 2022-11-08 17:57:34 +01:00
Arnaud Le Blanc
1cd217038e [ci skip] NEWS 2022-11-04 16:01:52 +01:00
Arnaud Le Blanc
1d67e34c49 [ci skip] NEWS 2022-11-04 15:58:07 +01:00
Christoph M. Becker
8bf6266e65
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix potential NULL pointer dereference Windows shm*() functions
2022-11-02 14:53:30 +01:00
Christoph M. Becker
d1c9ff5642
Fix potential NULL pointer dereference Windows shm*() functions
`shm_get()` (not to be confused with `shmget()`) returns `NULL` if
reallocation fails; we need to cater to that when calling the function.

Closes GH-9872.
2022-11-02 14:51:59 +01:00
Jakub Zelenka
29f7c4613e
Merge branch 'PHP-8.0' into PHP-8.1 2022-10-30 11:43:11 +00:00
Jakub Zelenka
1c5844aa3e
Fix GH-9754: SaltStack hangs when running php-fpm 8.1.11
SaltStack uses Python subprocess and redirects stderr to stdout which is
then piped to the returned output. If php-fpm starts in daemonized mode,
it should close stderr. However a fix introduced in GH-8913 keeps stderr
around so it can be later restored. That causes the issue reported in
GH-9754. The solution is to keep stderr around only when php-fpm runs in
foreground as the issue is most likely visible only there. Basically
there is no need to restore stderr when php-fpm is daemonized.
2022-10-30 11:41:33 +00:00
Kamil Tekiela
bce12f4e57
Add NEWS entry for #9841 2022-10-28 11:23:37 +01:00
Kamil Tekiela
96049867d8
Add NEWS entry for #9841
Closes GH-9841
2022-10-27 18:29:17 +01:00
Remi Collet
c84d7cc27e
move CVEs in 8.1.12 changelog 2022-10-26 17:10:29 +02:00
Remi Collet
db28ee8fd0
move CVEs in 8.0.25 changelog 2022-10-26 15:27:23 +02:00
Stanislav Malyshev
2caa79e963 Merge branch 'PHP-8.0' into PHP-8.1 2022-10-23 18:53:26 -06:00
Stanislav Malyshev
80ccaa3e36 Merge branch 'PHP-7.4' into PHP-8.0 2022-10-23 18:52:56 -06:00
Stanislav Malyshev
2669ed7d77 Update NEWS 2022-10-23 18:50:53 -06:00
David Carlier
fe06c5ef60 Merge branch 'PHP-8.0' into PHP-8.1 2022-10-23 00:46:25 +01:00
Adam Saponara
45e224cf51 Fix GH-9709: Guard against current_execute_data==NULL in is_handle_exception_set 2022-10-23 00:46:05 +01:00
Jakub Zelenka
ec844ccc3f
Merge branch 'PHP-8.0' into PHP-8.1 2022-10-22 22:12:05 +01:00
Jakub Zelenka
fa1b6ab5db Fix GH-8430: OpenSSL compiled with old disgests does not build
Specifically no-md2, no-md4 or no-rmd160 were not supported
2022-10-22 22:11:05 +01:00
Arnaud Le Blanc
386bbf4655 [ci skip] NEWS 2022-10-22 10:44:37 +02:00
Arnaud Le Blanc
845c6b3b3b [ci skip] NEWS 2022-10-22 10:43:11 +02:00
Stanislav Malyshev
248f647724 Fix bug #81738 (buffer overflow in hash_update() on long parameter) 2022-10-20 23:57:35 -06:00
Derick Rethans
41a6a298d9 Update NEWS 2022-10-17 18:22:29 +01:00
Arnaud Le Blanc
e3c40c6829 [ci skip] NEWS 2022-10-16 12:44:05 +02:00
Arnaud Le Blanc
f702f87f70 [ci skip] NEWS 2022-10-16 12:43:21 +02:00
Christoph M. Becker
24c297086d
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9720: Null pointer dereference while serializing the response
2022-10-13 16:00:36 +02:00
Christoph M. Becker
e440e37fa8
Fix GH-9720: Null pointer dereference while serializing the response
When traversing the result array, we need to cater to `param_name`
possibly being `NULL`.  Prior to PHP 7.0.0, this was implicitly done
because `param_name` was of type `char*`.

Closes GH-9739.
2022-10-13 15:56:08 +02:00
Christoph M. Becker
7e14d2466a
Fix potential heap corruption due to alignment mismatch
The fix for bug 63327[1] changed the extra size of mysqlnd allocations
from `sizeof(size_t)` to the properly aligned values; however, the
allocation in `_mysqlnd_pestrdup()` has apparently been overlooked,
which (currently) causes detectable heap corruption when running
mysqli_get_client_stats.phpt on 32bit Windows versions.

[1] <338a47bb85>

Closes GH-9724.
2022-10-13 11:47:24 +02:00
Ben Ramsey
865161af33
PHP-8.1 is now for PHP 8.1.13-dev 2022-10-11 19:47:00 -04:00
Gabriel Caruso
dd394b3dff
Prepare for PHp 8.0.26 2022-10-11 15:24:53 +02:00
Christoph M. Becker
20680b885b
[ci skip] Add missing NEWS entry 2022-10-10 14:00:41 +02:00
David Carlier
be53e5e5bb Fix GH-9566: disable assembly for Fiber on FreeBSD i386.
preparing in case there is more architectures especially the not tested.
2022-10-10 12:31:38 +01:00
Arnaud Le Blanc
878b20bdc9 [ci skip] NEWS 2022-10-01 11:24:08 +02:00
Arnaud Le Blanc
33375e927c [ci skip] NEWS 2022-10-01 11:23:15 +02:00
Remi Collet
12c3636d01
add missing CVEs 2022-09-30 09:19:03 +02:00
Remi Collet
b0cc5ed91f
add missing CVEs 2022-09-30 09:18:03 +02:00
Derick Rethans
ad8d00b47b Prepare for next release 2022-09-28 10:14:50 +01:00
Derick Rethans
0b4e153394 Prepare for 7.4.32 2022-09-28 10:07:43 +01:00
George Peter Banyard
72cb47338e
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9583: session_create_id() fails with user defined save handler that doesn't have a validateId() method
2022-09-27 15:54:37 +01:00
George Peter Banyard
8b115254c0
Fix GH-9583: session_create_id() fails with user defined save handler that doesn't have a validateId() method 2022-09-27 15:52:21 +01:00
Derick Rethans
6f586ef90f Add CVEs 2022-09-27 14:10:02 +01:00
wxue1
52f4ed16e0 Indirect call reduction for Jit code
Changing indirect call to direct call for Jit code
benefits the branch prediction, which gets 1% performance
gain in our workload.
Similarly, we change indirect jump to direct jump.

Signed-off-by: Su, Tao <tao.su@intel.com>
Signed-off-by: Wang, Xue <xue1.wang@intel.com>
2022-09-22 11:22:27 +01:00
Anatol Belski
54701ea3e7 NEWS: Add entry for GH-8805
[ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
2022-09-18 15:39:07 +02:00
Sara Golemon
559da529a0
Bump for 8.0.25 2022-09-13 23:46:26 +00:00
Patrick Allaert
0f575aa698
PHP-8.1 is now for PHP 8.1.12-dev 2022-09-13 23:09:47 +02:00
George Peter Banyard
71e198be25 Merge branch 'PHP-8.0' into PHP-8.1 2022-09-13 12:45:42 +01:00
George Peter Banyard
47500f3300 Fix GH-9421 Incorrect argument number for ValueError in NumberFormatter
Closes GH-9489
2022-09-13 12:42:58 +01:00
George Peter Banyard
3d5df064ca Merge branch 'PHP-8.0' into PHP-8.1 2022-09-13 11:33:09 +01:00
George Peter Banyard
293e69179d Fix GH-9308 GMP throws the wrong error when a GMP object is passed to gmp_init()
Closes GH-9490
2022-09-13 11:24:19 +01:00
Christoph M. Becker
404e8bdb68 Fix #81726: phar wrapper: DOS when using quine gzip file
The phar wrapper needs to uncompress the file; the uncompressed file
might be compressed, so the wrapper implementation loops. This raises
potential DOS issues regarding too deep or even infinite recursion (the
latter are called compressed file quines[1]). We avoid that by
introducing a recursion limit; we choose the somewhat arbitrary limit
`3`.

This issue has been reported by real_as3617 and gPayl0ad.

[1] <https://honno.dev/gzip-quine/>
2022-09-09 17:10:04 +01:00
Derick Rethans
0611be4e82 Fix #81727: Don't mangle HTTP variable names that clash with ones that have a specific semantic meaning. 2022-09-09 17:10:04 +01:00
Ilija Tovilo
d5373eac46
Fix lsp error in eval'd code referring to incorrect class for static type
Fixes GH-9407
Closes GH-9471
2022-09-08 10:52:27 +02:00
Ilija Tovilo
1435fc6262
Private method incorrectly marked as "overwrites" in reflection
Fix GH-9409
Closes GH-9469
2022-09-08 10:43:25 +02:00
Christoph M. Becker
b5cad508fe
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9411: PgSQL large object resource is incorrectly closed
2022-09-05 17:26:13 +02:00
Yurun
6ac3f7c84d
Fix GH-9411: PgSQL large object resource is incorrectly closed
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-9411.
2022-09-05 16:37:54 +02:00
Arnaud Le Blanc
6deddd3950 [ci skip] NEWS 2022-09-02 13:53:20 +02:00
Arnaud Le Blanc
6aedc5eaf0 [ci skip] NEWS 2022-09-02 13:48:56 +02:00
Ilija Tovilo
2cfb028e22
Fix class name FQN when AST dumping new and class const
Fixes GH-9447
Closes GH-9462
2022-09-02 08:57:26 +02:00
Niklas Keller
f8b217a345
Fix pcre.jit on Apple Silicon
This backports https://github.com/zherczeg/sljit/pull/105. Relates to bug #80435, however, it doesn't solve the bus error on PHP 8.0, but PHP 8.1 builds fine now.

Closes GH-9279.
2022-08-31 14:22:44 +02:00
Ben Ramsey
1862152145
Revert "Fix GH-9296: ksort behaves incorrectly on arrays with mixed keys"
This reverts commit cd1aed8edd, as
discussed on internals (<https://externals.io/message/118483>).
2022-08-30 09:13:46 -05:00
Jakub Zelenka
bf97b3649d
Merge branch 'PHP-8.0' into PHP-8.1 2022-08-29 22:33:02 +01:00
Jakub Zelenka
3503b1daa2
Fix bug #77780: "Headers already sent" when previous connection was aborted
This change primarily splits SAPI deactivation to module and destroy
parts. The reason is that currently some SAPIs might bail out
on deactivation. One of those SAPI is PHP-FPM that can bail out on
request end if for example the connection is closed by the client
(web sever). The problem is that in such case the resources are not
freed and some values reset. The most visible impact can have not
resetting the PG(headers_sent) which can cause erorrs in the next
request. One such issue is described in #77780 bug which this fixes
and is also cover by a test in this commit. It seems reasonable
to separate deactivation and destroying of the resource which means
that the bail out will not impact it.
2022-08-29 22:25:53 +01:00
Jakub Zelenka
be45f540ee
Merge branch 'PHP-8.0' into PHP-8.1 2022-08-29 14:40:57 +01:00
Dmitry Menshikov
f92505cf24
Fix GH-8885: access.log with stderr writes logs to error_log after reload
This fix allows restoring the the original stderr so the logs are
correctly written.
2022-08-29 14:39:24 +01:00
Christoph M. Becker
725cb4e8ad
Revert "Fix GH-9296: ksort behaves incorrectly on arrays with mixed keys"
This reverts commit cd1aed8edd, as
discussed on internals (<https://externals.io/message/118483>).
2022-08-29 12:41:36 +02:00
Christoph M. Becker
6427c4b858
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9361: Segmentation fault on script exit
2022-08-22 13:00:48 +02:00
Christoph M. Becker
bb341210f5
Fix GH-9361: Segmentation fault on script exit
Using a lot of memory may overflow some `int` calculations; to avoid
that we make sure that the operands are promoted to `size_t`.

This issue has been analyzed by @chschneider.

Closes GH-9379.
2022-08-22 12:59:17 +02:00
Christoph M. Becker
9bd9e9a867
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #79451: DOMDocument->replaceChild on doctype causes double free
2022-08-19 18:13:48 +02:00
NathanFreeman
6027d441c1
Fix #79451: DOMDocument->replaceChild on doctype causes double free
We have to reset intSubset if replacing doctype with another doctype node.

Closes GH-9201.
Closes GH-9376.
2022-08-19 18:10:06 +02:00
George Peter Banyard
eb8ea14c66 Merge branch 'PHP-8.0' into PHP-8.1 2022-08-19 13:57:19 +01:00
George Peter Banyard
d6831e9a5c Revert Fixed bug #79451
The fix for 8.1 and above is not identical and I don't know how to fix without breaking the whole build apparently
2022-08-19 13:54:54 +01:00
George Peter Banyard
c36a1ea1ae Merge branch 'PHP-8.0' into PHP-8.1 2022-08-19 12:52:58 +01:00
Tim Starling
ba029fce68 Fix GH-9323: crash when the VM enters userspace code via the GC
Closes GH-9323
2022-08-19 12:50:02 +01:00
NathanFreeman
1d4300d870 Fix bug #79451: Using DOMDocument->replaceChild on doctype causes double free
Closes GH-9201
2022-08-19 12:46:23 +01:00
Christoph M. Becker
5d196d9e7c
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9316: $http_response_header is wrong for long status line
2022-08-18 12:30:45 +02:00
Christoph M. Becker
72da418719
Fix GH-9316: $http_response_header is wrong for long status line
While the reason-phrase in a HTTP response status line is usually
short, there is no actual limit specified by the RFCs.  As such, we
must not assume that the line fits into the buffer (which is currently
128 bytes large).

Since there is no real need to present the complete status line, we
simply read and discard the rest of a long line.

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>

Closes GH-9319.
2022-08-18 12:27:54 +02:00
Jakub Zelenka
93bed982e8
Merge branch 'PHP-8.0' into PHP-8.1 2022-08-17 19:50:16 +01:00
Jakub Zelenka
84dcf578b1
Fix GH-9339: OpenSSL oid_file path check warning contains uninitialized path 2022-08-17 19:49:36 +01:00
Gabriel Caruso
7c6316ad1c
Prepare for 8.0.24 2022-08-17 11:56:42 +02:00
Ben Ramsey
7f26661993
PHP-8.1 is now for PHP 8.1.11-dev 2022-08-16 10:45:29 -05:00
Christoph M. Becker
306da80f56
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Correct IntlDateFormatter::formatObject params
2022-08-15 17:58:52 +02:00
Gert de Pagter
05ed47ef12
Correct IntlDateFormatter::formatObject params
Closes GH-9341.
2022-08-15 17:56:34 +02:00
Jakub Zelenka
7f64a8d59f
[skip ci] Add missing NEWS entry for GH-8409 fix to PHP-8.1 branch (skip-ci) 2022-08-14 14:18:28 +01:00
twosee
b8d07451d4
Re-fix GH-8409: SSL handshake timeout persistent connections hanging
This fix is another solution to replace d0527427be, use zend_try and zend_catch to make sure persistent stream will be released when error occurred.

Closes GH-9332.
2022-08-14 20:13:36 +08:00
Jakub Zelenka
897ca85d33
Revert "Fix GH-8409: SSL handshake timeout persistent connections hanging"
This reverts commit d0527427be.

This patch makes Swoole/Swow can not work anymore, because Coroutine will yield to another one during socket operation, EG(record_errors) assertion will always fail, and zend_begin_record_errors() was only used during compile time before.
Note: zend_emit_recorded_errors() and the typo fix are reserved.
2022-08-14 19:41:06 +08:00
Jakub Zelenka
d0527427be
Fix GH-8409: SSL handshake timeout persistent connections hanging
This is not actually related to SSL handshake but stream socket creation
which does not clean errors if the error handler is set. This fix
prevents emitting errors until the stream is freed.
2022-08-12 17:09:24 +01:00
Christoph M. Becker
71c22efae7
Fix GH-9309: Segfault when connection is used after imap_close()
We actually need to check whether `php_imap_object.imap_stream` is
`NULL` to detect that the connection has already been closed.

Closes GH-9313.
2022-08-12 16:24:30 +02:00
Christoph M. Becker
7908aae30c
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9296: `ksort` behaves incorrectly on arrays with mixed keys
2022-08-12 11:36:24 +02:00
Denis Vaksman
cd1aed8edd
Fix GH-9296: ksort behaves incorrectly on arrays with mixed keys
The comparator function used at ksort in SORT_REGULAR mode
need to be consistent with basic comparison rules. These rules
were changed in PHP-8.0 for numeric strings, but comparator
used at ksort kept the old behaviour. It leads to inconsistent
situations, when after ksort the first key is GREATER than some
of the next ones by according to the basic comparison operators.

Closes GH-9293.
2022-08-12 11:32:23 +02:00
Michael Olšavský
0709578517
Fix GH-9266: GC root buffer keeps growing when dtors are present
Do not reset cleared count on GC rerun.

Closes GH-9265.
2022-08-09 14:16:11 +02:00
Jakub Zelenka
c9fa98a174
Merge branch 'PHP-8.0' into PHP-8.1 2022-08-07 14:21:39 +01:00
Jakub Zelenka
d9ff5e079f
Fix GH-8472: stream_socket_accept result may have incorrect metadata 2022-08-07 14:17:38 +01:00
zeriyoshi
2d777466c0 Merge remote-tracking branch 'upstream/PHP-8.0' into PHP-8.1 2022-08-05 00:06:04 +09:00
zeriyoshi
1ce2b56227 [CI skip] update NEWS 2022-08-05 00:05:12 +09:00
Go Kudo
3725717de1
Remove ZEND_DVAL_TO_LVAL_CAST_OK (#9215)
* Remove ZEND_DVAL_TO_LVAL_CAST_OK
As far as I can see, this operation should always use the _slow method, and the results seem to be wrong when ZEND_DVAL_TO_LVAL_CAST_OK is enabled.

* update NEWS
2022-08-04 23:56:19 +09:00
Gabriel Caruso
a08ffc7052
[ci-skip] Fix for bug #80047 was included in previous release
We are removing the entry in 8.0.23, as the fix was included
in the 8.0.22 release. Given that an entry already exists, we
are just deleting extra lines.
2022-08-02 10:32:06 +02:00
Arnaud Le Blanc
832e0ef31f [ci skip] NEWS 2022-08-01 19:32:02 +02:00
Ilija Tovilo
565a416e87
Fix attribute target validation on fake closures
Fixes GH-8982
Closes GH-9173
2022-07-29 12:14:44 +02:00
Derick Rethans
a0c01f385c Add test case for GH-9601: DateInterval 1.5s added to DateTimeInterface is rounded down since PHP 8.1.0 2022-07-28 11:55:35 +01:00
Derick Rethans
001e7dbb04 Fixed bug #80047 (DatePeriod doesn't warn with custom DateTimeImmutable) 2022-07-28 10:28:10 +01:00
Christoph M. Becker
ca84d06bbc
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9032: SQLite3 authorizer crashes on NULL values
2022-07-27 13:06:15 +02:00
Christoph M. Becker
8ed21a89f3
Fix GH-9032: SQLite3 authorizer crashes on NULL values
The arguments 3 to 6 of the authorizer callback may be `NULL`[1], and
we have to properly deal with that.  Instead of causing a segfault, we
deny authorization, which is still better than a crash, and apparently,
we cannot do better anyway.

[1] <https://www.sqlite.org/c3ref/set_authorizer.html>

Closes GH-9040.
2022-07-27 12:49:16 +02:00
Christoph M. Becker
cf1664e91d
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9155: dba_open("non-existing", "c-", "flatfile") segfaults
2022-07-27 12:13:32 +02:00
Christoph M. Becker
a442e29485
Fix GH-9155: dba_open("non-existing", "c-", "flatfile") segfaults
We must not assume that the lock file has been opened.

Closes GH-9156.
2022-07-27 12:08:36 +02:00
Christoph M. Becker
4834cfea1a
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9033: Loading blacklist file can fail due to negative length
2022-07-25 16:32:18 +02:00
Christoph M. Becker
35fd97c3c9
Fix GH-9033: Loading blacklist file can fail due to negative length
If the blacklist file contains a line with a single double-quote, we
called `zend_strndup(pbuf, -1)` what causes an unnecessary bail out;
instead we just ignore that line.

If the blacklist file contains an empty line, we may have caused an OOB
read; instead we just ignore that line.

Closes GH-9036.
2022-07-25 16:30:19 +02:00
Derick Rethans
7831a1cae6 Add test case for GH-8964 2022-07-22 13:06:32 +01:00
George Peter Banyard
6cdfaf97e0
Update NEWS 2022-07-21 14:09:27 +01:00
George Peter Banyard
5b83b3a933
Fix memory leak in LMDB driver 2022-07-21 14:05:48 +01:00
Derick Rethans
3edf93d7ee Update NEWS 2022-07-21 12:34:45 +01:00
Christoph M. Becker
c2bdaa48e1
Fix GH-9008: mb_detect_encoding(): wrong results with null $encodings
Passing `null` to `$encodings` is supposed to behave like passing the
result of `mb_detect_order()`.  Therefore, we need to remove the non-
encodings from the `elist` in this case as well.  Thus, we duplicate
the global `elist`, so we can modify it.

Closes GH-9063.
2022-07-20 16:58:55 +02:00
Christoph M. Becker
d430652935
Fix --CGI-- support of run-tests.php
The `--CGI--` section is supposed to be just a marker, and to be empty
as such.  However, a previous refactoring[1] broke that.

[1] <9140c9038a>

Closes GH-9061.
2022-07-20 14:41:28 +02:00
Patrick Allaert
9af3327176
PHP-8.1 is now for PHP 8.1.10-dev 2022-07-20 06:48:52 +02:00
Christoph M. Becker
32d55f7422
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9017: php_stream_sock_open_from_socket could return NULL
2022-07-19 17:07:27 +02:00
Heiko Weber
3b7babf9b3
Fix GH-9017: php_stream_sock_open_from_socket could return NULL
Closes GH-9020.
2022-07-19 17:06:02 +02:00