History log of /PHP-8.3/ext/spl/spl_fixedarray.c (Results 1 – 25 of 183)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 8494058a 27-Feb-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-13531: Unable to resize SplfixedArray after being unserialized in PHP 8.2.15

When unserializing, the cached_resize field was not reset to -1
correctly, causing the setSize() metho

Fix GH-13531: Unable to resize SplfixedArray after being unserialized in PHP 8.2.15

When unserializing, the cached_resize field was not reset to -1
correctly, causing the setSize() method to think we were inside of a
resize operation.

Closes GH-13543.

show more ...


# b71c6b2c 13-Aug-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

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 destruct

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.

show more ...


# d5ad7510 08-Jun-2023 George Peter Banyard

More usage of known zend_str instead of C string (#11381)


# 99fa740a 06-Jun-2023 George Peter Banyard

Use common function for TypeError on illegal offset access (#10544)

This merges all usages of emitting an offset TypeError into a new ZEND_API function
zend_illegal_container_offset(cons

Use common function for TypeError on illegal offset access (#10544)

This merges all usages of emitting an offset TypeError into a new ZEND_API function
zend_illegal_container_offset(const zend_string* container, const zval *offset, int type);

Where the container should represent the type on which the access is attempted (e.g. string, array)
The offset zval that is used, where the error message will display its type
The type of access, which should be a BP_VAR_* constant, to get special message for isset/empty/unset

show more ...


# 47b3fe47 24-Mar-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Handle indirect zvals and use up-to-date properties in SplFixedArray::__serialize

Closes GH-10925.


# 0d524eda 27-Mar-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Revert "Handle indirect zvals in SplFixedArray::__serialize"

This reverts commit e6989382296250b1983422c0b8730cd773f26ea7.


# e6989382 24-Mar-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Handle indirect zvals in SplFixedArray::__serialize

Closes GH-10925.


# a0826966 22-Mar-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-10907: Unable to serialize processed SplFixedArrays in PHP 8.2.4

The properties table can also contain numeric entries after a rebuild of
the table based on the array. Since the a

Fix GH-10907: Unable to serialize processed SplFixedArrays in PHP 8.2.4

The properties table can also contain numeric entries after a rebuild of
the table based on the array. Since the array can only contain numeric
entries, and the properties table can contain a mix of both, we'll add
the numeric entries from the array and only the string entries from the
properties table. To implement this we simply check if the key from the
properties table is a string.

Closes GH-10921.

show more ...


# 90047253 26-Feb-2023 Marcos Marcolin <48370677+marcosmarcolin@users.noreply.github.com>

chore: standardize the visibility of functions. (#10708)

Co-authored-by: Marcos Marcolin <marcos@ixcsoft.com.br>


# 641fe23e 08-Feb-2023 Marcos Marcolin <48370677+marcosmarcolin@users.noreply.github.com>

Improve illegal offset error messages (#10504)

Co-authored-by: Marcos Marcolin <marcos@ixcsoft.com.br>


# c4ecd82f 24-Oct-2022 Tyson Andre

Make inspecting SplFixedArray instances more memory efficient/consistent, change print_r null props handling (#9757)

* Make handling of SplFixedArray properties more consistent

Crea

Make inspecting SplFixedArray instances more memory efficient/consistent, change print_r null props handling (#9757)

* Make handling of SplFixedArray properties more consistent

Create a brand new reference counted array every time in SplFixedArray
to be freed by the callers (or return null).
Switch from overriding `get_properties` to overriding `get_properties_for` handler

* Print objects with null hash table like others in print_r

Noticed when working on subsequent commits for SplFixedArray.
Make whether zend_get_properties_for returns null or an empty array
invisible to the end user - it would be always be a non-null array for
user-defined classes.
Always print newlines with `\n\s*(\n\s*)` after objects

Noticed when working on SplFixedArray changes, e.g. in
ext/spl/tests/SplFixedArray__construct_param_null.phpt

show more ...


# 70ad93dd 15-Sep-2022 Nikita Popov

Fix serialization of empty SplFixedArray

Avoid null pointer deref.


# d1fc0017 14-Sep-2022 Bob Weinand

Revert "Fix compilation on MacOS"

This reverts commit 800c6672e57a01d68dcaba36f8f7d65c6871aafc.

Reverted along with a01dd9fedaecd2e5b95bc5c2e8d6542116addeae.


Revision tags: php-8.2.0RC1, php-8.1.10, php-8.0.23
# 800c6672 24-Aug-2022 Bob Weinand

Fix compilation on MacOS

memrchr has an always available equivalent under the name of zend_memrchr.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>


# adb45a63 30-Aug-2022 Máté Kocsis

Fix GH-9186 @strict-properties can be bypassed using unserialization (#9354)

* Emit deprecation warnings when adding dynamic properties to classes during unserialization - this will become a

Fix GH-9186 @strict-properties can be bypassed using unserialization (#9354)

* Emit deprecation warnings when adding dynamic properties to classes during unserialization - this will become an Error in php 9.0.
(Adding dynamic properties in other contexts was already a deprecation warning - the use case of unserialization was overlooked)
* Throw an error when attempting to add a dynamic property to a `readonly` class when unserializing
* Add new serialization methods `__serialize`/`__unserialize` for SplFixedArray to avoid creating deprecated dynamic
properties that would then be added to the backing fixed-size array
* Don't add named dynamic/declared properties (e.g. $obj->foo) of SplFixedArray to the backing array when unserializing
* Update tests to declare properties or to expect the deprecation warning
* Add news entry

Co-authored-by: Tyson Andre <tysonandre775@hotmail.com>

show more ...


Revision tags: php-8.0.23RC1, php-8.1.10RC1, php-8.2.0beta3, php-8.2.0beta2, php-8.1.9, php-8.0.22, php-8.1.9RC1, php-8.2.0beta1, php-8.0.22RC1, php-8.0.21, php-8.1.8, php-8.2.0alpha3
# 3b92a966 25-Jun-2022 Ilija Tovilo

Convert return type of various object handlers from int to zend_result (#8755)


Revision tags: php-8.1.8RC1, php-8.2.0alpha2, php-8.0.21RC1, php-8.0.20, php-8.1.7, php-8.2.0alpha1, php-7.4.30, php-8.1.7RC1, php-8.0.20RC1, php-8.1.6, php-8.0.19, php-8.1.6RC1, php-8.0.19RC1
# cfc38a60 13-Apr-2022 George Peter Banyard

SPL: minor refactoring (#8341)

Use more appropriate types and return macros


Revision tags: php-8.0.18, php-8.1.5, php-7.4.29, php-8.1.5RC1, php-8.0.18RC1, php-8.1.4, php-8.0.17, php-8.1.4RC1, php-8.0.17RC1
# cd1c6f0b 24-Feb-2022 Tyson Andre

Fixes infinite recursion introduced by patch to SplFixedArray (#8105)

Closes GH-8079

Track whether the spl_fixedarray was modified since the last call to
get_properties


Revision tags: php-8.1.3, php-8.0.16, php-7.4.28
# c77bbcd4 11-Feb-2022 Dmitry Stogov

Fixed GH-8041 (php 8.2.0-dev crashes with assertion for cloning/get_object_vars on non-empty SplFixedArray)


# 52ae6417 11-Feb-2022 Dmitry Stogov

Fixed GH-8044 (var_export/debug_zval_dump HT_ASSERT_RC1 debug failure for SplFixedArray)


Revision tags: php-8.1.3RC1, php-8.0.16RC1, php-8.1.2, php-8.0.15, php-8.1.2RC1, php-8.0.15RC1, php-8.0.14, php-8.1.1, php-7.4.27, php-8.1.1RC1, php-8.0.14RC1
# 024d5f4b 01-Dec-2021 Tyson Andre

Cache method overrides of ArrayAccess in zend_class_entry

Previously, code such as subclasses of SplFixedArray would check for method
overrides when instantiating the objects.

T

Cache method overrides of ArrayAccess in zend_class_entry

Previously, code such as subclasses of SplFixedArray would check for method
overrides when instantiating the objects.

This optimization was mentioned as a followup to GH-6552

show more ...


Revision tags: php-7.4.27RC1, php-8.1.0, php-8.0.13, php-7.4.26, php-7.3.33, php-8.1.0RC6, php-7.4.26RC1, php-8.0.13RC1, php-8.1.0RC5, php-7.3.32, php-7.4.25, php-8.0.12, php-8.1.0RC4, php-8.0.12RC1, php-7.4.25RC1, php-8.1.0RC3, php-8.0.11
# 2d668409 21-Sep-2021 Christoph M. Becker

Fix #80663: Recursive SplFixedArray::setSize() may cause double-free

We address the `::setSize(0)` case by setting `array->element = NULL`
and `array->size = 0` before we destroy the ele

Fix #80663: Recursive SplFixedArray::setSize() may cause double-free

We address the `::setSize(0)` case by setting `array->element = NULL`
and `array->size = 0` before we destroy the elements.

Co-authored-by: Tyson Andre <tyson.andre@uwaterloo.ca>

Closes GH-7503.

show more ...


# 44489348 24-Sep-2021 Nikita Popov

Don't mark SplFixedArray as REUSE_GET_ITERATOR

This flag only has an effect (or use) for Iterators, not for
IteratorAggregates. Removing the confusing flag.


Revision tags: php-7.4.24, php-7.3.31, php-8.1.0RC2
# b053192a 14-Sep-2021 Tyson Andre

Fix #81429: Handle resizing in SplFixedArray::offsetSet (#7487)

offsetSet did not account for the fact that the array may no longer exist after
the field is overwritten. This fixes that.

Fix #81429: Handle resizing in SplFixedArray::offsetSet (#7487)

offsetSet did not account for the fact that the array may no longer exist after
the field is overwritten. This fixes that.

Add test of resizing both to the empty array and a smaller array - there should
be no valgrind warnings with a proper fix.

Alternate approach to #7486 (described in https://bugs.php.net/bug.php?id=81429)

show more ...


Revision tags: php-7.4.24RC1, php-8.0.11RC1, php-8.1.0RC1
# 5b2ddf5a 31-Aug-2021 Nikita Popov

Export zend_use_resource_as_offset()

Use a common implementation to generate this error message, as
we do so in quite a few places dealing with array keys.


12345678