mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-2235 swapping code bug fix
X-SVN-Rev: 13750
This commit is contained in:
parent
aa109b8431
commit
dc41bb7735
2 changed files with 2 additions and 2 deletions
|
@ -1076,7 +1076,7 @@ ucnv_swap(const UDataSwapper *ds,
|
|||
size=(int32_t)(mbcsHeader.offsetFromUBytes+mbcsHeader.fromUBytesLength);
|
||||
} else {
|
||||
/* there is extension data after the base data, see ucnv_ext.h */
|
||||
if(length<(extOffset+UCNV_EXT_INDEXES_MIN_LENGTH*4)) {
|
||||
if(length>=0 && length<(extOffset+UCNV_EXT_INDEXES_MIN_LENGTH*4)) {
|
||||
udata_printError(ds, "ucnv_swap(): too few bytes (%d after headers) for an ICU MBCS .cnv conversion table with extension data\n",
|
||||
length);
|
||||
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
|
|
|
@ -2011,7 +2011,7 @@ uchar_swapNames(const UDataSwapper *ds,
|
|||
}
|
||||
|
||||
/* swap the group table */
|
||||
count=*((const uint16_t *)(inBytes+groupsOffset));
|
||||
count=ds->readUInt16(*((const uint16_t *)(inBytes+groupsOffset)));
|
||||
ds->swapArray16(ds, inBytes+groupsOffset, (int32_t)((1+count*3)*2),
|
||||
outBytes+groupsOffset, pErrorCode);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue