Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Sep 14, 2021

Conversation

TysonAndre
Copy link
Contributor

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 (approach described in https://bugs.php.net/bug.php?id=81429)

This targets PHP 7.4 because this is a bug fix. The Z_ISUNDEF change becomes unnecessary in later minor PHP versions due to ca8657a

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 php#7486 (described in https://bugs.php.net/bug.php?id=81429)
ext/spl/spl_fixedarray.c Outdated Show resolved Hide resolved
ext/spl/spl_fixedarray.c Outdated Show resolved Hide resolved
ext/spl/spl_fixedarray.c Outdated Show resolved Hide resolved
ext/spl/spl_fixedarray.c Outdated Show resolved Hide resolved
NULL
[3]=>
NULL
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: missing newline

Copy link
Contributor

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@TysonAndre TysonAndre merged commit b053192 into php:PHP-7.4 Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants