Skip to content

ICU-23120 Fix malloc request larger than PTRDIFF_MAX bytes #3496

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SoapGentoo
Copy link

    work/icu/source/test/intltest/ustrtest.cpp: In member function ‘void UnicodeStringTest::TestLargeMemory()’:
    work/icu/source/test/intltest/ustrtest.cpp:2360:37: error: size ‘4294967286’ of array exceeds maximum object size ‘2147483647’
     2360 |     char16_t *buf = new char16_t[len];
          |                                     ^

Checklist

  • Required: Issue filed: ICU-NNNNN
  • Required: The PR title must be prefixed with a JIRA Issue number. Example: "ICU-1234 Fix xyz"
  • Required: Each commit message must be prefixed with a JIRA Issue number. Example: "ICU-1234 Fix xyz"
  • Issue accepted (done by Technical Committee after discussion)
  • Tests included, if applicable
  • API docs and/or User Guide docs changed or added, if applicable

* glibc does not allow allocations that exceed PTRDIFF_MAX bytes:
  https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9bf8e29ca136094f73f69f725f15c51facc97206
* Without this, we get compile failures on 32-bit platforms:

    work/icu/source/test/intltest/ustrtest.cpp: In member function ‘void UnicodeStringTest::TestLargeMemory()’:
    work/icu/source/test/intltest/ustrtest.cpp:2360:37: error: size ‘4294967286’ of array exceeds maximum object size ‘2147483647’
     2360 |     char16_t *buf = new char16_t[len];
          |                                     ^
@CLAassistant
Copy link

CLAassistant commented May 16, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants