Commit Graph

15466 Commits

Author SHA1 Message Date
Niels Dossche
ecf0bb0fd1
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS
  Backport libxml2 2.13.2 fixes (#14816)
2024-07-04 15:37:35 +02:00
Niels Dossche
a5a63f2904
[ci skip] NEWS 2024-07-04 15:32:05 +02:00
David Carlier
15bea9ed74
Fix GH-14775: range overflow on negative step.
overflow occurs since we only deal with positive steps.

close GH-14778
2024-07-03 18:57:25 +01:00
Go Kudo
3f08bcbdf8 Merge remote-tracking branch 'upstream/PHP-8.2' into PHP-8.3 2024-07-03 14:54:07 +09:00
Go Kudo
cd67080236
[ci skip] fix NEWS typo (#14777) 2024-07-03 14:53:33 +09:00
David Carlier
2edf12e87f
Fix GH-14638: null dereference after XML parsing failure.
object document is null if the parsing had failed prior to cast to
string.
2024-07-01 22:36:32 +01:00
Niels Dossche
015b5195ae
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Factor out common check for short-circuited ast
  Fix OSS-Fuzz #69765: Yield reference to nullsafe chain
2024-06-30 13:38:44 +02:00
Niels Dossche
d568337680
Fix OSS-Fuzz #69765: Yield reference to nullsafe chain
You cannot return or yield a reference to a nullsafe chain. This was
checked already in zend_compile_return but not yet in
zend_compile_yield.

Closes GH-14716.
2024-06-30 13:38:06 +02:00
David Carlier
1b71a9e01f
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-29 15:52:28 +01:00
David Carlier
c03196a5be
Fix GH-14712: segfault on invalid object.
If the extension does not allow to get a property pointer (like PDORow
object), we fallback
to the read property cb anyway.
2024-06-29 15:51:57 +01:00
Niels Dossche
b63b100e36
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14563: Build failure with libxml2 v2.13.0
2024-06-29 16:28:51 +02:00
Niels Dossche
b08def5156
Fix GH-14563: Build failure with libxml2 v2.13.0
Remove xmlErrMemory from the export section for Windows, this fixes the
build. Even though the original function was renamed [1] it is hidden,
so removing this should be sufficient and not be a BC break.

[1] 130436917c

Closes GH-14719.
2024-06-29 16:28:16 +02:00
Niels Dossche
0a1f51deb3
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14702: DOMDocument::xinclude() crash
2024-06-28 22:22:12 +02:00
Niels Dossche
42908f9f68
Fix GH-14702: DOMDocument::xinclude() crash
The xinclude code from libxml removes the fallback node,
but the fallback node is still reference via $fallback.
The solution is to detach the nodes that are going to be removed in
advance.

Closes GH-14704.
2024-06-28 22:21:12 +02:00
Niels Dossche
41371900a8
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14590: Memory leak in FPM test gh13563-conf-bool-env.phpt
2024-06-28 22:08:18 +02:00
Niels Dossche
056bec72f4
Fix GH-14590: Memory leak in FPM test gh13563-conf-bool-env.phpt
Values retrieved from zend_getenv should be freed.
Note: The only possible value for `zend_getenv` is `sapi_getenv` which uses
zend alloc to duplicate the string that it reads from the SAPI module.

Closes GH-14708.
2024-06-28 22:05:15 +02:00
Niels Dossche
f97e2779b1
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] Move incorrectly placed NEWS items to the right place
2024-06-28 20:16:45 +02:00
Niels Dossche
643762cd78
[ci skip] Move incorrectly placed NEWS items to the right place 2024-06-28 20:16:19 +02:00
Niels Dossche
c19affc567
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14537: shmop Windows 11 crashes the process
2024-06-28 20:14:20 +02:00
Niels Dossche
39a3266576
Fix GH-14537: shmop Windows 11 crashes the process
The error handling code isn't entirely right in two places.
One of the code blocks is dead because of an always-false condition, and
another code block is missing the assignment of a NULL pointer.

Getting the exact same behaviour is not entirely possible because you
can't extend the size of a shared memory region after it was made with
the Windows APIs we use, unless we destroy the region and recreate it,
but that has other consequences.
However, it certainly shouldn't crash.

Closes GH-14707.
2024-06-28 20:13:47 +02:00
Arnaud Le Blanc
a5a75ae39d
[ci skip] NEWS for GH-14626 2024-06-25 15:17:24 +02:00
Arnaud Le Blanc
a9acc29a37
[ci skip] NEWS for GH-14626 2024-06-25 15:15:17 +02:00
Arnaud Le Blanc
e230610c76
[ci skip] NEWS for GH-13922 2024-06-24 19:57:00 +02:00
Arnaud Le Blanc
d7ef2c209a
[ci skip] NEWS for GH-13922 2024-06-24 19:55:47 +02:00
David Carlier
04418ede7a
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-21 05:08:21 +01:00
David Carlier
686afc10bf
Fix GH-14603: invalid null zip file entry.
close GH-14610
2024-06-21 05:07:46 +01:00
David Carlier
19ddb5f92d
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-21 05:03:30 +01:00
David Carlier
6704c60589
Fix GH-14596: phpdbg with asan and ZC_RC_DEBUG set crashes.
close GH-14607
2024-06-21 05:02:53 +01:00
Jakub Zelenka
387b1c62bf
PHP-8.3 is now for PHP-8.3.10-dev 2024-06-19 00:05:24 +01:00
Sergey Panteleev
49aaa7cd9f
PHP-8.2 is now for PHP 8.2.22-dev 2024-06-18 17:56:05 +03:00
David Carlier
8690d522a3
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-17 17:46:24 +01:00
David Carlier
03f0776d08
Fix GH-13681: segfault when adding watchpoint fails.
thus when removing its entry, no watch point is set and crash on
pointer access.

close GH-14513
2024-06-17 17:45:53 +01:00
Gina Peter Banyard
e9b36438ed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/soap: Fix memory leaks when calling SoapFault::__construct() twice
2024-06-16 23:01:36 +01:00
Gina Peter Banyard
df219ccf9d
ext/soap: Fix memory leaks when calling SoapFault::__construct() twice 2024-06-16 23:00:59 +01:00
Jakub Zelenka
ea79560190
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-16 12:23:15 +01:00
Wilhansen Li
43bc53a730
Fix GH-14037: Make /ping of php-fpm work with pm.status_listen pool
The ping feature of php-fpm monitoring was previously not working
in pm.status_listen pool due to the configuration variables ping.path
and ping.response not being copied over to the worker when forked. This
results in the ping code path being disabled because the worker detects
that ping.path is not configured.

Closes GH-13980

Co-authored-by: Pierrick Charron <pierrick@php.net>
2024-06-16 12:22:21 +01:00
Derick Rethans
784b745e07
Update NEWS 2024-06-13 14:04:42 +01:00
Derick Rethans
c595ab96ab
Update NEWS 2024-06-13 14:04:03 +01:00
Peter Kokot
7b40a5a9f3
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix incompatible function pointer types
2024-06-13 12:27:09 +02:00
Ryan Carsten Schmidt
b43378d830
Fix incompatible function pointer types
Closes #14549
2024-06-13 12:24:52 +02:00
Niels Dossche
ccdd1c4e67
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-11078: PHP Fatal error triggers pointer being freed was not allocated and malloc: double free for ptr errors
2024-06-10 19:39:25 +02:00
Niels Dossche
bc558bf7a3
Fix GH-11078: PHP Fatal error triggers pointer being freed was not allocated and malloc: double free for ptr errors
Although the issue was demonstrated using Curl, the issue is purely in
the streams layer of PHP.

Full analysis is written in GH-11078 [1], but here is the brief version:
Here's what actually happens:
1) We're creating a FILE handle from a stream using the casting mechanism.
   This will create a cookie-based FILE handle using funopen.
2) We're reading stream data using fread from the userspace stream. This will
   temporarily set a buffer into a field _bf.base [2]. This buffer is now equal
   to the upload buffer that Curl allocated and note that that buffer is owned
   by Curl.
3) The fatal error occurs and we bail out from the fread function, notice how
   the reset code is never executed and so the buffer will still point to
   Curl's upload buffer instead of FILE's own buffer [3].
4) The resources are destroyed, this includes our opened stream and because the
   FILE handle is cached, it gets destroyed as well.
   In fact, the stream code calls through fclose on purpose in this case.
5) The fclose code frees the _bs.base buffer [4].
   However, this is not the buffer that FILE owns but the one that Curl owns
   because it isn't reset properly due to the bailout!
6) The objects are getting destroyed, and so the curl free logic is invoked.
   When Curl tries to gracefully clean up, it tries to free the buffer.
   But that buffer is actually already freed mistakingly by the C library!

This also explains why we can't reproduce it on Linux: this bizarre buffer
swapping only happens on macOS and BSD, not on Linux.

To solve this, we switch to an unbuffered mode for cookie-based FILEs.
This avoids any stateful problems related to buffers especially when the
bailout mechanism triggers. As streams have their own buffering
mechanism, I don't expect this to impact performance.

[1] https://github.com/php/php-src/issues/11078#issuecomment-2155616843
[2] 5e566be7a7/stdio/FreeBSD/fread.c (L102-L103)
[3] 5e566be7a7/stdio/FreeBSD/fread.c (L117)
[4] 5e566be7a7/stdio/FreeBSD/fclose.c (L66-L67)

Closes GH-14524.
2024-06-10 19:38:21 +02:00
Florian Engelhardt
159f14c45f
fix memleak due to missing pthread_attr_destroy()-call
Closes GH-14510
2024-06-10 16:09:26 +02:00
Gina Peter Banyard
7bab3a3a80
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix bug GH-14456: Attempting to initialize class with private constructor calls destructor
2024-06-06 15:51:34 +01:00
Gina Peter Banyard
cdb7677b38
Fix bug GH-14456: Attempting to initialize class with private constructor calls destructor
Closes GH-14469
2024-06-06 15:50:41 +01:00
Eric Mann
9e1a1c104d
Fix NEWS typo 2024-06-05 10:21:52 -07:00
Niels Dossche
7fe03e1a1b
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix parameter numbers for imagecolorset()
2024-06-05 18:04:53 +02:00
Giovanni Giacobbi
da769be7c9
Fix parameter numbers for imagecolorset()
This is the 8.2 & 8.3 version of GH-14477.
2024-06-05 18:01:59 +02:00
Eric Mann
b8196977b9
[skip ci] update NEWS 2024-06-05 06:58:24 -07:00
Pierrick Charron
04b9bc2ae7
Merge branch 'PHP-8.2' into PHP-8.3 2024-06-05 09:06:52 -04:00