Commit Graph

14758 Commits

Author SHA1 Message Date
Ilija Tovilo
d8e866da04
Fix in-place modification of filename in php_message_handler_for_zend
php_strip_url_passwd modifies url in-place. We cannot assume from
php_message_handler_for_zend that data is a temporary, modifiable string.

Fixes oss-fuzz #64209
Closes GH-12733
2023-11-20 14:12:25 +01:00
Ilija Tovilo
ea52706a2a
Fix use-after-free of name in var-var with malicious error handler
Fixes oss-fuzz #54325
Closes GH-12732
2023-11-20 14:05:46 +01:00
Niels Dossche
4d41dffb4f Fix GH-12721: SplFileInfo::getFilename() segfault in combination with GlobIterator and no directory separator
This broke in 7cd8879 and 9bae9ab. NULL is a perfectly valid return
value that should be handled.

Closes GH-12722.
2023-11-19 11:52:27 +01:00
Jakub Zelenka
f90b40416f
Fix #50713: openssl_pkcs7_verify() may ignore untrusted CAs
Closes GH-12499
2023-11-17 19:42:28 +00:00
Niels Dossche
3167d07603 Fix GH-12616: DOM: Removing XMLNS namespace node results in invalid default: prefix
The namespace data is freed and set to NULL, but there remain references
to the namespace declaration nodes. This (rightfully) confuses libxml2
because its invariants are broken. We also have to remove all remaining
references from the subtree. This fixes the data corruption bug.

Closes GH-12681.
2023-11-17 19:47:08 +01:00
Niels Dossche
8a95e616b9 Fix GH-12702: libxml2 2.12.0 issue building from src
Fixes GH-12702.

Co-authored-by: nono303 <github@nono303.net>
2023-11-17 19:46:30 +01:00
Jakub Zelenka
6734880ef5
Fix bug #79945: Stream wrappers in imagecreatefrompng causes segfault
Closes GH-12696
2023-11-17 13:26:42 +00:00
Niels Dossche
4f1103ef3b Fix GH-12675: MEMORY_LEAK in phpdbg_prompt.c
Have to use file_put_contents() instead of --FILE-- because we have to
actually load it using the exec command, *and* have to make multiple
files, and note that we can only load files relative from the current
directory, so we can't rely on files being in the sapi/phpdbg/tests
folder.

Closes GH-12680.
2023-11-15 21:59:55 +01:00
Remi Collet
2536cf78b8
NEWS 2023-11-14 14:56:59 +01:00
Niels Dossche
86c7d3ed1f Fix GH-12655: proc_open() does not take into account references in the descriptor array
Closes GH-12658.
2023-11-13 19:29:44 +01:00
Niels Dossche
7353c7ce17 Fix GH-12621: browscap segmentation fault when configured in the vhost
The temporary HashTable has a destructor that releases the string held
by the entry's value. However, browscap_intern_str(_ci) only incremented
the refcount for the reference created by the return value. As the
HashTable is only used during parsing, we don't need to manage the
reference count of the value anyway, so get rid of the destructor.

This is triggerable in two cases:
 - When using php_admin_value to set the ini at the activation stage
 - When running out of space for the opcache-interned strings

Closes GH-12634.
2023-11-11 18:35:57 +01:00
Niels Dossche
333cf3c111 Fix GH-12635: Test bug69398.phpt fails with ICU 74.1
ICU 74.1 contains new locale data that breaks the test.
Split the test based on the version number to resolve the issue.

Closes GH-12653.
2023-11-11 17:04:01 +01:00
Niels Dossche
fbda6b50a3 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-12633: sqlite3_defensive.phpt fails with sqlite 3.44.0
  Fix GH-12628: The gh11374 test fails on Alpinelinux
2023-11-10 00:08:09 +01:00
SakiTakamachi
2a4775d6a7 Fix GH-12633: sqlite3_defensive.phpt fails with sqlite 3.44.0
Removes 'PRAGMA writable_schema;'.

From sqlite changelog https://www.sqlite.org/releaselog/3_44_0.html:
> The SQLITE_DBCONFIG_DEFENSIVE setting now prevents PRAGMA writable_schema
> from being turned on.
> Previously writable_schema could be turned on, but would not actually allow
> the schema to be writable. Now it simply cannot be turned on.

Closes GH-12636.
2023-11-10 00:03:33 +01:00
Niels Dossche
78fba9cb80 Fix GH-12628: The gh11374 test fails on Alpinelinux
Closes GH-12636.
2023-11-10 00:01:22 +01:00
Jakub Zelenka
c6eeb83e1f
Merge branch 'PHP-8.1' into PHP-8.2 2023-11-09 13:32:33 +00:00
Daniil Gentili
10b2b4a52c
Fix memory leak in standard syslog device handling
The BG(syslog_device) is leaked in RINIT.

Closes GH-12501
2023-11-09 13:29:09 +00:00
Ben Ramsey
55dfc29539
PHP-8.1 is now for PHP 8.1.27-dev 2023-11-07 14:28:31 -06:00
Sergey Panteleev
239a26fa90
PHP-8.2 is now for PHP 8.2.14-dev 2023-11-07 17:12:19 +03:00
Jakub Zelenka
882cc4f804
Merge branch 'PHP-8.1' into PHP-8.2 2023-11-03 17:17:23 +00:00
Jakub Zelenka
a8c6c6165b
Fix GH-9921: Loading ext in FPM config does not register module handlers
Closes GH-12377
2023-11-03 16:53:09 +00:00
Jakub Zelenka
e3d1beb0f1
Fix bug #76922: FastCGI terminates conn after FCGI_GET_VALUES
Closes GH-12387
2023-11-03 14:06:36 +00:00
Niels Dossche
304e482813 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix validation logic of php:function() callbacks in dom and xsl
2023-11-02 20:32:10 +01:00
Niels Dossche
20c9c4a367 Fix validation logic of php:function() callbacks in dom and xsl
Two issues:
- Assumed that at least 1 argument (function name) was provided.
- Incorrect error path for the non-callable case.

Closes GH-12593.
2023-11-02 20:28:55 +01:00
David Carlier
a39e869b55 Merge branch 'PHP-8.1' into PHP-8.2 2023-11-01 19:13:08 +00:00
David Carlier
0da1356c66 ext/intl: change when the locale is invalid for the 8.1/8.2 serie.
does not throws an exception as it's considered as a too string change,
but the code user still needs to double check.
2023-11-01 19:12:50 +00:00
Máté Kocsis
d4e40dc0e1
Fix GH-12558 Escape \N in generated stubs (#12562) 2023-10-31 10:06:56 +01:00
Arnaud Le Blanc
c7fda3b46f [ci skip] NEWS 2023-10-29 12:20:31 +01:00
Arnaud Le Blanc
29dbc4ae83 [ci skip] NEWS 2023-10-29 12:19:56 +01:00
Arnaud Le Blanc
ae9118a7e4 [ci skip] NEWS 2023-10-28 15:04:13 +02:00
Arnaud Le Blanc
bbfadd32e8 [ci skip] NEWS 2023-10-28 15:02:20 +02:00
Niels Dossche
1ea8a10ca8 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11374: Different preg_match result with -d pcre.jit=0
2023-10-27 17:44:56 +02:00
Michael Voříšek
83a505e85f Fix GH-11374: Different preg_match result with -d pcre.jit=0
This is a backport of https://github.com/PCRE2Project/pcre2/pull/300.

Closes GH-12439.
2023-10-27 17:43:33 +02:00
Niels Dossche
e39538bed0 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix bug #75306: Memleak in SoapClient
2023-10-26 19:59:00 +02:00
Niels Dossche
27797a26ca Fix bug #75306: Memleak in SoapClient
Setting the stream context via php_stream_context_to_zval() will
increase the reference count. So if the new context is created, then it
will end up with a reference count of 2 while it should be 1.

Credits to cmb for the analysis. I arrived at the same patch as he did.

Closes GH-12523.
2023-10-26 19:58:31 +02:00
Niels Dossche
07de4b69d4 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect dtor for persistent sdl->encoders
2023-10-25 17:54:46 +02:00
Niels Dossche
9f7f3b2034 Fix incorrect dtor for persistent sdl->encoders
Closes GH-12515.
2023-10-25 17:53:42 +02:00
Niels Dossche
dd8a945eb7 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  Fix null pointer dereferences in case of allocation failure
2023-10-24 19:36:57 +02:00
Niels Dossche
98908db72b [ci skip] NEWS 2023-10-24 19:35:55 +02:00
icy17
900f0cab9f Fix null pointer dereferences in case of allocation failure
Closes GH-12506.
2023-10-24 19:34:47 +02:00
Jakub Zelenka
275d36ea2f
Merge branch 'PHP-8.1' into PHP-8.2 2023-10-22 13:27:19 +01:00
Jakub Zelenka
52aa0d9ecc
Fix bug #75708: getimagesize with "&$imageinfo" fails on StreamWrappers
Closes GH-12444
2023-10-22 13:26:18 +01:00
Jakub Zelenka
b2f6b6ea9c
Merge branch 'PHP-8.1' into PHP-8.2 2023-10-22 13:21:56 +01:00
Jakub Zelenka
83a242ec0c
Fix GH-12489: Missing sigbio creation checking in openssl_cms_verify
Closes GH-12490
2023-10-22 13:20:43 +01:00
Niels Dossche
1b16646270 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix segfault and assertion failure with refcounted props and arrays
  Fix incorrect uri check in SOAP caching
  Fix bug #66150: SOAP WSDL cache race condition causes Segmentation Fault
2023-10-19 18:32:01 +02:00
Niels Dossche
01d61605d3 Fix segfault and assertion failure with refcounted props and arrays
Closes GH-12478.
2023-10-19 18:31:48 +02:00
Niels Dossche
abf562c417 Fix incorrect uri check in SOAP caching
If i == 0 then the check will compare 0 bytes.
We are supposed to check if the uri is identical.

Closes GH-12479.
2023-10-19 18:29:11 +02:00
Niels Dossche
43e63168e9 Fix bug #66150: SOAP WSDL cache race condition causes Segmentation Fault
When we have two processes both trying to cache a WSDL, they might start
writing the data to the same temporary file, causing file corruption due
to the race condition. Fix this by creating a temporary file first, and
then moving it to the final location. If moving fails then we know
another process finished caching first.

This also fixes #67617 as a consequence of its implementation.

Closes GH-12469.
2023-10-19 18:27:38 +02:00
Ilija Tovilo
4f1f77c51b
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix double-free of doc_comment when overriding static property via trait
2023-10-19 15:23:00 +02:00
Ilija Tovilo
af3d2f7ec9
Fix double-free of doc_comment when overriding static property via trait
When redeclaring an overridden static property with a trait we're removing the
property from the class. However, because the property itself does not belong to
the class we must not free its associated data.

This issue is exposed by 9a250cc9d6 in PHP 8.3+ because duplicate static
properties in traits are no longer skipped, but redeclared.

Fixes GH-12468
2023-10-19 15:21:53 +02:00