-
-
Notifications
You must be signed in to change notification settings - Fork 763
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ICU-22579 Fix Null deref while Unicode Set only has string
- Loading branch information
1 parent
8b14c05
commit 4a7d61d
Showing
5 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1224,6 +1224,7 @@ void RBBIRuleScanner::scanSet() { | |
UErrorCode localStatus = U_ZERO_ERROR; | ||
LocalPointer<UnicodeSet> uset(new UnicodeSet(), localStatus); | ||
if (U_FAILURE(localStatus)) { | ||
error(localStatus); | ||
return; | ||
} | ||
uset->applyPatternIgnoreSpace(fRB->fRules, pos, fSymbolTable, localStatus); | ||
|
@@ -1240,7 +1241,11 @@ void RBBIRuleScanner::scanSet() { | |
// Verify that the set contains at least one code point. | ||
// | ||
U_ASSERT(uset.isValid()); | ||
if (uset->isEmpty()) { | ||
UnicodeSet tempSet(*uset); | ||
// Use tempSet to handle the case that the UnicodeSet contains | ||
// only string element, such as [{ab}] and treat it as empty set. | ||
tempSet.removeAllStrings(); | ||
if (tempSet.isEmpty()) { | ||
// This set is empty. | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
FrankYFTang
Author
Contributor
|
||
// Make it an error, because it almost certainly is not what the user wanted. | ||
// Also, avoids having to think about corner cases in the tree manipulation code | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Hello, I noticed that this was the change here that cycled out the [{bof}] tag feature. I was wondering if there are any equivalents to something like this for the new versions (75.1)? I was able to use it with version 74.2 but the upgrade to 75.1 broke because of this.