Commit Graph

14806 Commits

Author SHA1 Message Date
Jakub Zelenka
1371ce9539
Update NEWS for start of RC2 2023-08-29 17:14:11 +01:00
Niels Dossche
0b9702c9ed Implement GH-11934: Allow to pass CData into struct and/or union fields
Co-authored-by: KapitanOczywisty <44417092+KapitanOczywisty@users.noreply.github.com>

Closes GH-11935.
2023-08-29 17:01:10 +02:00
Niels Dossche
a3a3964497 Fix oss-fuzz #61712: assertion failure with error handler during binary op
Because the error handler is invoked after the property is updated,
the error handler has the opportunity to remove it before the property
is returned.

Switching the order around fixes this issue. The comments mention that
the current ordering prevents overwriting the EG(std_property_info)
field in the error handler. EG(std_property_info) no longer exists as it
was removed in 7471c217. Back then a global was used to store the
returned property info, but as this is no longer the case there is no
longer a need to protect against overwriting a global.

Closes GH-12062.
2023-08-28 20:00:49 +02:00
Peter Kokot
1413787884 Merge branch 'PHP-8.2'
* PHP-8.2:
  On riscv64 require libatomic if actually needed
2023-08-28 19:48:49 +02:00
Peter Kokot
a1043fe051 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  On riscv64 require libatomic if actually needed
2023-08-28 19:47:44 +02:00
Jeremie Courreges-Anglas
bf3fb4e5c9 On riscv64 require libatomic if actually needed
clang and newer gcc releases support byte-sized atomic accesses on
riscv64 through inline builtins.  In both cases the hard dependency on
libatomic added by GH-11321 isn't useful.

Stop using AC_CHECK_LIB() which is too naive to notice that libatomic
isn't needed.  Instead, PHP_CHECK_FUNC() will retry the check with -latomic
if required.

Closes GH-11790
2023-08-28 19:47:19 +02:00
Jakub Zelenka
766cac072f
Fix bug #76857: Can read "non-existant" files
This change makes checked and opened file consistent in a way that it is
using real path for stat operation in the same way like it is used for
open.

Closes GH-12067
2023-08-28 16:53:28 +01:00
Jakub Zelenka
ba9650d697
Fix bug #52335 (fseek() on memory stream behavior different then file)
This changes memory stream to allow seeking past end which makes it the
same as seeking on files. It means the position is allowed to be higher
than the string length. The size only increases if data is appended to
the past position. The space between the previous string and position
is filled with zero bytes.

Fixes GH-9441
Closes GH-12058
2023-08-28 13:32:34 +01:00
Jakub Zelenka
aff46d75e1
Fix GH-11982: str_getcsv returns null byte for unterminated quoted string
Closes GH-12047
2023-08-28 11:28:34 +01:00
Mikhail Galanin
418cdc0bea
Set CLOEXEC on listened/accepted sockets in the FPM children
Closes GH-11708

Co-authored-by: Jakub Zelenka <bukka@php.net>
2023-08-26 15:19:03 +01:00
Niels Dossche
e1cb721679 Improve warning when returning null from the resolver set by libxml_set_external_entity_loader
Fixes GH-11952.
Closes GH-12022.
2023-08-24 21:23:29 +02:00
HypeMC
f25474f7f2
Add before_needle argument to strrchr()
Closes GH-11430
2023-08-24 14:26:46 +01:00
Jakub Zelenka
53aa53f42f
Introduce Zend guard recursion protection
This PR introduces a new way of recursion protection in JSON, var_dump
and friends. It fixes issue in master for __debugInfo and also improves
perf for jsonSerializable in some cases. More info can be found in
GH-10020.

Closes GH-11812
2023-08-24 13:03:14 +01:00
Niels Dossche
767697c4ae Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix memory leak when setting an invalid DOMDocument encoding
2023-08-20 14:07:25 +02:00
Niels Dossche
20ac42e1b0 Fix memory leak when setting an invalid DOMDocument encoding
Because the failure path did not release the string, there was a memory
leak.
As the only valid types for this function are IS_NULL and IS_STRING, we
and IS_NULL is always rejected in practice, solve the issue by not using
a function that increments the refcount in the first place.

Closes GH-12002.
2023-08-20 14:05:26 +02:00
David Carlier
f995c0df36 Merge branch 'PHP-8.1' into PHP-8.2 2023-08-19 23:09:41 +01:00
David Carlier
fc8d5c72e5 ext/iconv: fix build for netbsd.
NetBSD still adopts the old iconv signature for buffer inputs.
The next release will too so we can assume it will remain that way for
a while.

Close GH-12001
2023-08-19 23:09:22 +01:00
Ilija Tovilo
48ede64506
Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix segfault in format_default_value due to unexpected enum/object
2023-08-17 18:44:37 +02:00
Ilija Tovilo
9437aa9a8e
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix segfault in format_default_value due to unexpected enum/object
2023-08-17 18:43:49 +02:00
Ilija Tovilo
f78d1d0d10
Fix segfault in format_default_value due to unexpected enum/object
Evaluating constants at comptime can result in arrays that contain objects. This
is problematic for printing the default value of constant ASTs containing
objects, because we don't actually know what the constructor arguments were.
Avoid this by not propagating array constants.

Fixes GH-11937
Closes GH-11947
2023-08-17 18:43:11 +02:00
Kamil Tekiela
06bda99280
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix implicit/explicit port in mysqlnd
2023-08-16 20:33:52 +01:00
Kamil Tekiela
c1103a9772
Fix implicit/explicit port in mysqlnd 2023-08-16 18:59:07 +01:00
Pierrick Charron
4467f33e89
PHP-8.2 is now for PHP 8.2.11-dev 2023-08-15 16:08:52 -04:00
Eric Mann
32fa67331b
Update NEWS for PHP 8.3.0beta3 2023-08-15 12:45:42 -07:00
Patrick Allaert
6e3f93f2f8
PHP-8.1 is now for PHP 8.1.24-dev 2023-08-15 21:09:58 +02:00
Niels Dossche
d46dc5694c Fix various namespace prefix conflict resolution bugs and namespace shift bugs
There are two linked issues:

- Conflicts couldn't be resolved by changing the prefix name.
- Lacking a prefix would shift the namespace as the default namespace,
  causing elements to suddenly become part of the namespace instead of
  the attributes.

The output could still be improved by removing redundant namespace
declarations, but that's another issue. At least the output is
correct now.

Closes GH-11777.
2023-08-15 20:42:42 +02:00
George Peter Banyard
82972f448f Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix various bugs related to DNF types
2023-08-15 17:01:51 +01:00
George Peter Banyard
02a80c5b82 Fix various bugs related to DNF types
- GH-11958: DNF types in trait properties do not get bound properly
 - GH-11883: Memory leak in zend_type_release() for non-arena allocated DNF types
 - Internal trait bound to userland class would not be arena allocated
 - Property DNF types were not properly deep copied during lazy loading

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
Co-authored-by: ju1ius <jules.bernable@gmail.com>
2023-08-15 15:34:33 +01:00
Niels Dossche
0b516aea25 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix #81992: SplFixedArray::setSize() causes use-after-free
2023-08-14 21:34:04 +02:00
Niels Dossche
b71c6b2c6c Fix #81992: SplFixedArray::setSize() causes use-after-free
Upon resizing, the elements are destroyed from lower index to higher
index. When an element refers to an object with a destructor, it can
refer to a lower (i.e. already destroyed) element, causing a uaf.
Set refcounted zvals to NULL after destroying them to avoid a uaf.

Closes GH-11959.
2023-08-14 21:32:22 +02:00
Ilija Tovilo
ee000ea186
Fix uouv on oom on object allocation
We may OOM during object initialization. In this case, free_obj needs to guard
against NULL values. There may be more cases where this is an issue, these were
the ones I was able to discover via script.

Fixes GH-11734
2023-08-14 11:10:00 +02:00
Niels Dossche
bb092ab4c6 Fix #80927: Removing documentElement after creating attribute node: possible use-after-free
Closes GH-11892.
2023-08-12 18:49:12 +02:00
Kamil Tekiela
7a4b213c1f
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix error checking in mysqlnd
2023-08-10 15:25:37 +01:00
Kamil Tekiela
0d922aa595
Fix error checking in mysqlnd
Closes GH-11925
2023-08-10 15:23:54 +01:00
Niels Dossche
23ba4cde53 Align DOMChildNode parent checks with spec
Closes GH-11905.
2023-08-09 21:24:33 +02:00
Derick Rethans
b71d2e16e6 Fix GH-11416: Crash with DatePeriod when uninitialised objects are passed in (PHP 8.2+) 2023-08-09 16:10:14 +01:00
Derick Rethans
4833b84854 Fix GH-11416: Crash with DatePeriod when uninitialised objects are passed in 2023-08-09 15:39:13 +01:00
Niels Dossche
8f1cbc8dea Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix segfault when DOMParentNode::prepend() is called when the child disappears
2023-08-08 20:07:11 +02:00
Niels Dossche
d19e4da125 Fix segfault when DOMParentNode::prepend() is called when the child disappears
Closes GH-11906.
2023-08-08 20:06:39 +02:00
George Peter Banyard
c9c846d63e Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix off-by-one bug when truncating tempnam prefix
2023-08-08 09:52:18 +01:00
George Peter Banyard
1ff59b9ad9 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix off-by-one bug when truncating tempnam prefix
2023-08-08 09:51:02 +01:00
Athos Ribeiro
cbfd73765a Fix off-by-one bug when truncating tempnam prefix
The tempnam documentation currently states that "Only the first 63
characters of the prefix are used, the rest are ignored". However when
the prefix is 64 characters-long, the current implementation fails to
strip the last character, diverging from the documented behavior. This
patch fixes the implementation so it matches the documented behavior for
that specific case where the prefix is 64 characters long.

Closes GH-11870

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-08-08 09:46:27 +01:00
Niels Dossche
87148f6de2 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix viable next sibling search for replaceWith
2023-08-07 20:21:05 +02:00
Niels Dossche
815b5ad501 Fix viable next sibling search for replaceWith
Closes GH-11888.
2023-08-07 20:19:31 +02:00
David CARLIER
3e315df6f8 Merge branch 'PHP-8.2' 2023-08-07 19:02:55 +01:00
David CARLIER
e9e5b4c1c8 Merge branch 'PHP-8.1' into PHP-8.2 2023-08-07 19:02:44 +01:00
Kévin Dunglas
96885bc04f fix: handle the GNU specific version of strerror_r
Close GH-11882
2023-08-07 19:01:24 +01:00
Niels Dossche
b80ded8303 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11830: ParentNode methods should perform their checks upfront
  Fix manually calling __construct() on DOM classes
2023-08-07 19:47:27 +02:00
Niels Dossche
dddd309da4 Fix GH-11830: ParentNode methods should perform their checks upfront
Closes GH-11887.
2023-08-07 19:39:05 +02:00
Niels Dossche
08c4db7f36 Fix manually calling __construct() on DOM classes
Closes GH-11894.
2023-08-07 19:37:47 +02:00