Skip to content

Tweak $count range check of array_fill() #8804

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

Closed
wants to merge 2 commits into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Jun 16, 2022

start_key + num is supposed to fit into a zend_long, so we should
not allow to pass values which won't.

We also fix the UNEXPECTED(EXPECTED(…)), which does not make sense,
and replace the magic number with the respective macro. We also add a test case to verify the expected behavior for an array_fill() edge case.

`start_key + num` is supposed to fit into a `zend_long`, so we should
not allow to pass values which won't.

We also fix the `UNEXPECTED(EXPECTED(…))`, which does not make sense,
and replace the magic number with the respective macro.
@cmb69 cmb69 marked this pull request as ready for review June 16, 2022 20:52
@cmb69 cmb69 marked this pull request as draft June 17, 2022 18:12
This is by design, and is supposed to have the same behavior like doing
the operations manually.  We add a test to verify this behavior.
@cmb69 cmb69 changed the title Avoid wrap-around in array_fill() Tweak $count range check of array_fill() Jun 20, 2022
@cmb69 cmb69 marked this pull request as ready for review June 20, 2022 12:45
@cmb69 cmb69 closed this in a1b05a3 Jun 21, 2022
@cmb69 cmb69 deleted the cmb/array_fill branch June 21, 2022 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants