Skip to content

ext/standard/tests: use %d instead of bytes in an overflow message #14788

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 1 commit into from

Conversation

orlitzky
Copy link
Contributor

@orlitzky orlitzky commented Jul 3, 2024

In strings/chunk_split_variation1_32bit.phpt, we have a test that is expected to fail on x32 with a possible integer overflow error. The message reports the exact number of bytes -- a number big enough to overflow an int on x32 -- stemming from a memory allocation in chunk_split().

This number appears unpredictable, and is not the point of the test. We replace it with %d to make the test independent of the allocation details.

(This fixes half of https://bugs.gentoo.org/935382)

In strings/chunk_split_variation1_32bit.phpt, we have a test that is
expected to fail on x32 with a possible integer overflow error. The
message reports the exact number of bytes -- a number big enough to
overflow an int on x32 -- stemming from a memory allocation in
chunk_split().

This number appears unpredictable, and is not the point of the test.
We replace it with %d to make the test independent of the allocation
details.
@petk
Copy link
Member

petk commented Jul 3, 2024

Thanks for finding this. This is probably best to go to PHP-8.2 so it's fixed also there (when merging)...

@petk
Copy link
Member

petk commented Jul 3, 2024

Merged via a8d1955 to PHP-8.2 and up.

@petk petk closed this Jul 3, 2024
@orlitzky
Copy link
Contributor Author

orlitzky commented Jul 3, 2024

Thanks! The other half of our bug report looks related but I got sidetracked. I'll deal with it in a minute.

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.

3 participants