Skip to content

Conversation

@poliudian-iv
Copy link
Contributor

@poliudian-iv poliudian-iv commented Dec 22, 2025

Fix errors found by static analyzer (clangsa), when analyze chromium code. Part 5
icu4c/source/common/filteredbrk.cpp - partials can be nullptr after unsuccessful allocate memory
icu4c/source/common/loclikelysubtags.cpp - "Null pointer passed to 1st parameter expecting 'nonnull'"
icu4c/source/common/normalizer2impl.cpp - "Dereference of null pointer"
icu4c/source/common/ubidiln.cpp

  • "The left expression of the compound assignment uses uninitialized memory" for insertRemove
  • "Out of bound access to memory after the end of the heap area" - for runCount
  • "The right operand of '+' is a garbage value" - for pLogicalStart

icu4c/source/common/ubidiwrt.cpp - all doWriteXY can return only U_BUFFER_OVERFLOW_ERROR
icu4c/source/common/ucnv.cpp - "Address of stack memory associated with local variable 'replay' is still referred to by the caller variable 'args' upon returning to the caller. This will be a dangling reference"
icu4c/source/common/ucnv2022.cpp - "Out of bound access to memory after the end of 'jpCharsetMasks'" at changeState_2022
icu4c/source/common/unames.cpp - "Out of bound access to memory after the end of 'indexes'"
icu4c/source/common/unormcmp.cpp - "Out of bound access to memory preceding 'fold2'"
icu4c/source/common/ustrcase.cpp - "Out of bound access to memory preceding 'fold2'"
icu4c/source/i18n/calendar.cpp - "The right operand of '+' is a garbage value"
icu4c/source/i18n/collationweights.cpp - "Left shift by '32' overflows the capacity of 'unsigned int'"
icu4c/source/i18n/nfrs.cpp - "Division by zero"
icu4c/source/i18n/rbt_pars.cpp - "Out of bound access to memory preceding the field 'preContext'"
icu4c/source/i18n/stsearch.cpp - "Access to field 'matchedIndex' results in a dereference of a null pointer (loaded from field 'm_search_')"
icu4c/source/i18n/tridpars.cpp - "Access to field 'valueDeleter' results in a dereference of a null pointer (loaded from variable 'hash')"
icu4c/source/common/unisetspan.cpp - "Undefined or garbage value returned to caller"

Thank you for your pull request!

TODO: Fill out the checklist below.

Checklist

  • Required: Issue filed: ICU-23300
  • Required: The PR title must be prefixed with a JIRA Issue number. Example: "ICU-23300 Fix xyz"
  • Required: Each commit message must be prefixed with a JIRA Issue number. Example: "ICU-23300 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
  • Approver: Feel free to merge on my behalf

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4c/source/common/unisetspan.cpp is now changed in the branch
  • icu4c/source/i18n/stsearch.cpp is now changed in the branch
  • icu4c/source/i18n/tridpars.cpp is now changed in the branch

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@poliudian-iv poliudian-iv changed the title Fix static analyzer errors ICU-23300 Fix static analyzer errors Dec 22, 2025
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.

1 participant