Skip to content

ICU-23113 Add nullptr handle for in CollationDataBuilder::addCE32 #3486

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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions icu4c/source/i18n/collationdatabuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,10 @@ CollationDataBuilder::addCE32(const UnicodeString &prefix, const UnicodeString &
// If c has contextual base mappings or if we add a contextual mapping,
// then copy the base mappings.
// Otherwise we just override the base mapping.
if (base == nullptr){
U_FAILURE(U_INTERNAL_PROGRAM_ERROR);
return;
}
uint32_t baseCE32 = base->getFinalCE32(base->getCE32(c));
if(hasContext || Collation::ce32HasContext(baseCE32)) {
oldCE32 = copyFromBaseCE32(c, baseCE32, true, errorCode);
Expand Down