ICU-8361 Fix array overrun in Indic layout engine

X-SVN-Rev: 30478
This commit is contained in:
John Emmons 2011-08-08 21:00:35 +00:00
parent c651458559
commit 900d537065
2 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,6 @@
/*
/ *
* (C) Copyright IBM Corp. 1998-2009 - All Rights Reserved
* (C) Copyright IBM Corp. 1998-2011 - All Rights Reserved
*
*/
@ -241,7 +241,7 @@ public:
le_uint32 saveAuxData = fGlyphStorage.getAuxData(i+inv_count,success);
const SplitMatra *splitMatra = classTable->getSplitMatra(matraClass);
int j;
for (j = 0 ; *(splitMatra)[j] != 0 ; j++) {
for (j = 0 ; j < SM_MAX_PIECES && *(splitMatra)[j] != 0 ; j++) {
LEUnicode piece = (*splitMatra)[j];
if ( j == 0 ) {
fOutChars[i+inv_count] = piece;
@ -332,7 +332,7 @@ public:
const SplitMatra *splitMatra = classTable->getSplitMatra(matraClass);
int i;
for (i = 0; i < 3 && (*splitMatra)[i] != 0; i += 1) {
for (i = 0; i < SM_MAX_PIECES && (*splitMatra)[i] != 0; i += 1) {
LEUnicode piece = (*splitMatra)[i];
IndicClassTable::CharClass pieceClass = classTable->getCharClass(piece);

View File

@ -1,6 +1,6 @@
/*
*
* (C) Copyright IBM Corp. 1998-2009 - All Rights Reserved
* (C) Copyright IBM Corp. 1998-2011 - All Rights Reserved
*
*/
@ -71,7 +71,9 @@ U_NAMESPACE_BEGIN
#define SF_POST_BASE_LIMIT_MASK 0x0000FFFFU
#define SF_NO_POST_BASE_LIMIT 0x00007FFFU
typedef LEUnicode SplitMatra[3];
#define SM_MAX_PIECES 3
typedef LEUnicode SplitMatra[SM_MAX_PIECES];
class MPreFixups;
class LEGlyphStorage;