ICU-7083 incorporate review comments.

X-SVN-Rev: 30060
This commit is contained in:
Andy Heninger 2011-05-09 02:56:05 +00:00
parent cf26986c13
commit 6396036807

View File

@ -98,8 +98,12 @@ RuleBasedBreakIterator::RuleBasedBreakIterator(const uint8_t *compiledRules,
if (U_FAILURE(status)) {
return;
}
if (compiledRules == NULL || ruleLength < sizeof(RBBIDataHeader)) {
status = U_ILLEGAL_ARGUMENT_ERROR;
return;
}
const RBBIDataHeader *data = (const RBBIDataHeader *)compiledRules;
if (data->fLength != ruleLength) {
if (data->fLength > ruleLength) {
status = U_ILLEGAL_ARGUMENT_ERROR;
return;
}