Repository navigation
Conversation
When allocating enough room for floats, the allocator used overflows with large ndigits/EG(precision) value which used an signed integer to increase the size of thebuffer. Testing with the zend operator directly is enough to trigger the issue rather than higher level math interface.
devnexen
marked this pull request as ready for review
September 2, 2024 17:55
Girgias
reviewed
Sep 9, 2024
| size_t j = sizeof(ULong); | ||
| for(k = 0; | ||
| sizeof(Bigint) - sizeof(ULong) - sizeof(int) + (size_t)j <= (size_t)i; | ||
| sizeof(Bigint) - sizeof(ULong) - sizeof(int) + j <= (size_t)i; |
Member
There was a problem hiding this comment.
Shouldn't k and i also be size_t ? Seems like this file could make use of a bit of cleanup to get rid of all the K&R definitions
Member
Author
There was a problem hiding this comment.
I thought of it for sure but :
- the issue is on
jincrementation alone. - it is a stable branch, I think the cleanup you mention is more appropriate for
masterbranch (thinking if there is more implications fromint=>size_tchanges also, etc)
Member
There was a problem hiding this comment.
Ah right this targets 8.2... yeah sure then do the minimal changes
Girgias
reviewed
Sep 10, 2024
Comment on lines
3610
to
3614
Member
There was a problem hiding this comment.
I thought you wanted to only do this change in master? As you didn't properly update the KR version here.
Member
Author
There was a problem hiding this comment.
no I do not want to, I think changing j (and eventually k) here should suffice wdyt ?
Member
There was a problem hiding this comment.
I think changing just j is fine.
devnexen
added a commit
to devnexen/php-src
that referenced
this pull request
Nov 8, 2024
Choosing here to shrink the requested allocation to its max value.
devnexen
added a commit
that referenced
this pull request
Nov 8, 2024
Choosing here to shrink the requested allocation to its max value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When allocating enough room for floats, the allocator used overflows with
large ndigits/EG(precision) value which used an signed integer to
increase the size of thebuffer.
Testing with the zend operator directly is enough to trigger
the issue rather than higher level math interface.