diff --git a/.hgtags b/.hgtags index 55b79fdc70eae35e013402e4a054116c75188b56..2e613529235c240c01223a216deb31924b2ab5db 100644 --- a/.hgtags +++ b/.hgtags @@ -464,6 +464,7 @@ c8cfbe57bcd5042d2fef42dcef14d73dd4bdc416 jdk8u60-b25 fe1c420a8982e58f6d49c50b729732d93f9682dd jdk8u65-b05 3ee40ba7525d6d5ee201a475b967ca2e5c3c9ab3 jdk8u65-b06 bd2ad7acb217391747dae8263c090483af454313 jdk8u65-b07 +d215cd281678e4b89a4155755cd6e03e37b7e9b1 jdk8u65-b08 e9f82302d5fdef8a0976640e09363895e9dcde3c jdk8u66-b00 64d7bd4e98150447916f210e3bfd6875a4c2728a jdk8u66-b01 d8210091911b14930192abd3138ee37c281fb632 jdk8u66-b02 diff --git a/src/share/native/sun/font/layout/IndicRearrangementProcessor.cpp b/src/share/native/sun/font/layout/IndicRearrangementProcessor.cpp index a5f308844a3f3024a43365894296dc033d04db48..15bca3800b28a91f48f14a39809b0cc37b5edc94 100644 --- a/src/share/native/sun/font/layout/IndicRearrangementProcessor.cpp +++ b/src/share/native/sun/font/layout/IndicRearrangementProcessor.cpp @@ -76,14 +76,14 @@ ByteOffset IndicRearrangementProcessor::processStateEntry(LEGlyphStorage &glyphS } if (flags & irfMarkFirst) { - firstGlyph = currGlyph; + firstGlyph = (le_uint32)currGlyph; } if (flags & irfMarkLast) { - lastGlyph = currGlyph; + lastGlyph = (le_uint32)currGlyph; } - doRearrangementAction(glyphStorage, (IndicRearrangementVerb) (flags & irfVerbMask)); + doRearrangementAction(glyphStorage, (IndicRearrangementVerb) (flags & irfVerbMask), success); if (!(flags & irfDontAdvance)) { // XXX: Should handle reverse too... @@ -97,18 +97,29 @@ void IndicRearrangementProcessor::endStateTable() { } -void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphStorage, IndicRearrangementVerb verb) const +void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphStorage, IndicRearrangementVerb verb, LEErrorCode &success) const { LEGlyphID a, b, c, d; le_int32 ia, ib, ic, id, ix, x; - LEErrorCode success = LE_NO_ERROR; + + if (LE_FAILURE(success)) return; + + if (verb == irvNoAction) { + return; + } + if (firstGlyph > lastGlyph) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + return; + } switch(verb) { - case irvNoAction: - break; - case irvxA: + if (firstGlyph == lastGlyph) break; + if (firstGlyph + 1 < firstGlyph) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; ia = glyphStorage.getCharIndex(firstGlyph, success); x = firstGlyph + 1; @@ -125,6 +136,11 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto break; case irvDx: + if (firstGlyph == lastGlyph) break; + if (lastGlyph - 1 > lastGlyph) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } d = glyphStorage[lastGlyph]; id = glyphStorage.getCharIndex(lastGlyph, success); x = lastGlyph - 1; @@ -153,6 +169,11 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto break; case irvxAB: + if ((firstGlyph + 2 < firstGlyph) || + (lastGlyph - firstGlyph < 1)) { // difference == 1 is a no-op, < 1 is an error. + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; ia = glyphStorage.getCharIndex(firstGlyph, success); @@ -174,6 +195,11 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto break; case irvxBA: + if ((firstGlyph + 2 < firstGlyph) || + (lastGlyph - firstGlyph < 1)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; ia = glyphStorage.getCharIndex(firstGlyph, success); @@ -195,6 +221,11 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto break; case irvCDx: + if ((lastGlyph - 2 > lastGlyph) || + (lastGlyph - firstGlyph < 1)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } c = glyphStorage[lastGlyph - 1]; d = glyphStorage[lastGlyph]; ic = glyphStorage.getCharIndex(lastGlyph - 1, success); @@ -216,6 +247,11 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto break; case irvDCx: + if ((lastGlyph - 2 > lastGlyph) || + (lastGlyph - firstGlyph < 1)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } c = glyphStorage[lastGlyph - 1]; d = glyphStorage[lastGlyph]; ic = glyphStorage.getCharIndex(lastGlyph - 1, success); @@ -237,6 +273,11 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto break; case irvCDxA: + if ((lastGlyph - 2 > lastGlyph) || + (lastGlyph - firstGlyph < 2)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; c = glyphStorage[lastGlyph - 1]; d = glyphStorage[lastGlyph]; @@ -262,6 +303,11 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto break; case irvDCxA: + if ((lastGlyph - 2 > lastGlyph) || + (lastGlyph - firstGlyph < 2)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; c = glyphStorage[lastGlyph - 1]; d = glyphStorage[lastGlyph]; @@ -287,6 +333,11 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto break; case irvDxAB: + if ((firstGlyph + 2 < firstGlyph) || + (lastGlyph - firstGlyph < 2)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; d = glyphStorage[lastGlyph]; @@ -312,6 +363,11 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto break; case irvDxBA: + if ((firstGlyph + 2 < firstGlyph) || + (lastGlyph - firstGlyph < 2)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; d = glyphStorage[lastGlyph]; @@ -337,6 +393,10 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto break; case irvCDxAB: + if (lastGlyph - firstGlyph < 3) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; @@ -359,6 +419,10 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto break; case irvCDxBA: + if (lastGlyph - firstGlyph < 3) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; @@ -381,6 +445,10 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto break; case irvDCxAB: + if (lastGlyph - firstGlyph < 3) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; @@ -403,6 +471,10 @@ void IndicRearrangementProcessor::doRearrangementAction(LEGlyphStorage &glyphSto break; case irvDCxBA: + if (lastGlyph - firstGlyph < 3) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; diff --git a/src/share/native/sun/font/layout/IndicRearrangementProcessor.h b/src/share/native/sun/font/layout/IndicRearrangementProcessor.h index 271c6167339a71ef05c9d1f6850f310f6e6b7984..36af0ff12547a726a132a2e5059074a61d7a7d9c 100644 --- a/src/share/native/sun/font/layout/IndicRearrangementProcessor.h +++ b/src/share/native/sun/font/layout/IndicRearrangementProcessor.h @@ -56,7 +56,7 @@ public: virtual void endStateTable(); - void doRearrangementAction(LEGlyphStorage &glyphStorage, IndicRearrangementVerb verb) const; + void doRearrangementAction(LEGlyphStorage &glyphStorage, IndicRearrangementVerb verb, LEErrorCode &success) const; IndicRearrangementProcessor(const LEReferenceTo &morphSubtableHeader, LEErrorCode &success); virtual ~IndicRearrangementProcessor(); @@ -76,8 +76,8 @@ public: static UClassID getStaticClassID(); protected: - le_int32 firstGlyph; - le_int32 lastGlyph; + le_uint32 firstGlyph; + le_uint32 lastGlyph; LEReferenceTo indicRearrangementSubtableHeader; LEReferenceToArrayOf entryTable; diff --git a/src/share/native/sun/font/layout/IndicRearrangementProcessor2.cpp b/src/share/native/sun/font/layout/IndicRearrangementProcessor2.cpp index 1cf169b7686ff864d6008917d6697ef0e3022174..2a94c101f2a2a898752ce7b2936a8e86dead3e48 100644 --- a/src/share/native/sun/font/layout/IndicRearrangementProcessor2.cpp +++ b/src/share/native/sun/font/layout/IndicRearrangementProcessor2.cpp @@ -74,14 +74,14 @@ le_uint16 IndicRearrangementProcessor2::processStateEntry(LEGlyphStorage &glyphS } if (flags & irfMarkFirst) { - firstGlyph = currGlyph; + firstGlyph = (le_uint32)currGlyph; } if (flags & irfMarkLast) { - lastGlyph = currGlyph; + lastGlyph = (le_uint32)currGlyph; } - doRearrangementAction(glyphStorage, (IndicRearrangementVerb) (flags & irfVerbMask)); + doRearrangementAction(glyphStorage, (IndicRearrangementVerb) (flags & irfVerbMask), success); if (!(flags & irfDontAdvance)) { currGlyph += dir; @@ -94,18 +94,29 @@ void IndicRearrangementProcessor2::endStateTable() { } -void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphStorage, IndicRearrangementVerb verb) const +void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphStorage, IndicRearrangementVerb verb, LEErrorCode &success) const { LEGlyphID a, b, c, d; le_int32 ia, ib, ic, id, ix, x; - LEErrorCode success = LE_NO_ERROR; + + if (LE_FAILURE(success)) return; + + if (verb == irvNoAction) { + return; + } + if (firstGlyph > lastGlyph) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + return; + } switch(verb) { - case irvNoAction: - break; - case irvxA: + if (firstGlyph == lastGlyph) break; + if (firstGlyph + 1 < firstGlyph) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; ia = glyphStorage.getCharIndex(firstGlyph, success); x = firstGlyph + 1; @@ -122,6 +133,11 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt break; case irvDx: + if (firstGlyph == lastGlyph) break; + if (lastGlyph - 1 > lastGlyph) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } d = glyphStorage[lastGlyph]; id = glyphStorage.getCharIndex(lastGlyph, success); x = lastGlyph - 1; @@ -150,6 +166,11 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt break; case irvxAB: + if ((firstGlyph + 2 < firstGlyph) || + (lastGlyph - firstGlyph < 1)) { // difference == 1 is a no-op, < 1 is an error. + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; ia = glyphStorage.getCharIndex(firstGlyph, success); @@ -171,6 +192,11 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt break; case irvxBA: + if ((firstGlyph + 2 < firstGlyph) || + (lastGlyph - firstGlyph < 1)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; ia = glyphStorage.getCharIndex(firstGlyph, success); @@ -192,6 +218,11 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt break; case irvCDx: + if ((lastGlyph - 2 > lastGlyph) || + (lastGlyph - firstGlyph < 1)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } c = glyphStorage[lastGlyph - 1]; d = glyphStorage[lastGlyph]; ic = glyphStorage.getCharIndex(lastGlyph - 1, success); @@ -213,6 +244,11 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt break; case irvDCx: + if ((lastGlyph - 2 > lastGlyph) || + (lastGlyph - firstGlyph < 1)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } c = glyphStorage[lastGlyph - 1]; d = glyphStorage[lastGlyph]; ic = glyphStorage.getCharIndex(lastGlyph - 1, success); @@ -234,6 +270,11 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt break; case irvCDxA: + if ((lastGlyph - 2 > lastGlyph) || + (lastGlyph - firstGlyph < 2)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; c = glyphStorage[lastGlyph - 1]; d = glyphStorage[lastGlyph]; @@ -259,6 +300,11 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt break; case irvDCxA: + if ((lastGlyph - 2 > lastGlyph) || + (lastGlyph - firstGlyph < 2)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; c = glyphStorage[lastGlyph - 1]; d = glyphStorage[lastGlyph]; @@ -284,6 +330,11 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt break; case irvDxAB: + if ((firstGlyph + 2 < firstGlyph) || + (lastGlyph - firstGlyph < 2)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; d = glyphStorage[lastGlyph]; @@ -309,6 +360,11 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt break; case irvDxBA: + if ((firstGlyph + 2 < firstGlyph) || + (lastGlyph - firstGlyph < 2)) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; d = glyphStorage[lastGlyph]; @@ -334,6 +390,10 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt break; case irvCDxAB: + if (lastGlyph - firstGlyph < 3) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; @@ -356,6 +416,10 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt break; case irvCDxBA: + if (lastGlyph - firstGlyph < 3) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; @@ -378,6 +442,10 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt break; case irvDCxAB: + if (lastGlyph - firstGlyph < 3) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; @@ -400,6 +468,10 @@ void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphSt break; case irvDCxBA: + if (lastGlyph - firstGlyph < 3) { + success = LE_INDEX_OUT_OF_BOUNDS_ERROR; + break; + } a = glyphStorage[firstGlyph]; b = glyphStorage[firstGlyph + 1]; diff --git a/src/share/native/sun/font/layout/IndicRearrangementProcessor2.h b/src/share/native/sun/font/layout/IndicRearrangementProcessor2.h index f58ac9b71fc4b0720263befe99cf4def8532d057..b68abe1695c454c4bfc89e8624be26d765fc0384 100644 --- a/src/share/native/sun/font/layout/IndicRearrangementProcessor2.h +++ b/src/share/native/sun/font/layout/IndicRearrangementProcessor2.h @@ -56,7 +56,7 @@ public: virtual void endStateTable(); - void doRearrangementAction(LEGlyphStorage &glyphStorage, IndicRearrangementVerb verb) const; + void doRearrangementAction(LEGlyphStorage &glyphStorage, IndicRearrangementVerb verb, LEErrorCode &success) const; IndicRearrangementProcessor2(const LEReferenceTo &morphSubtableHeader, LEErrorCode &success); virtual ~IndicRearrangementProcessor2(); @@ -76,8 +76,8 @@ public: static UClassID getStaticClassID(); protected: - le_int32 firstGlyph; - le_int32 lastGlyph; + le_uint32 firstGlyph; + le_uint32 lastGlyph; LEReferenceToArrayOf entryTable; LEReferenceTo indicRearrangementSubtableHeader; diff --git a/src/share/native/sun/font/layout/MorphTables.cpp b/src/share/native/sun/font/layout/MorphTables.cpp index 483f720e5ad94e3608dd280dc8c86e04437a9857..152b94774ba47435024592d11ada90230b6e2beb 100644 --- a/src/share/native/sun/font/layout/MorphTables.cpp +++ b/src/share/native/sun/font/layout/MorphTables.cpp @@ -75,6 +75,7 @@ void MorphTableHeader::process(const LETableReference &base, LEGlyphStorage &gly return; } subtableHeader.addOffset(length, success); + if (LE_FAILURE(success)) break; } SubtableCoverage coverage = SWAPW(subtableHeader->coverage); FeatureFlags subtableFeatures = SWAPL(subtableHeader->subtableFeatures); @@ -91,6 +92,8 @@ void MorphSubtableHeader::process(const LEReferenceTo &base { SubtableProcessor *processor = NULL; + if (LE_FAILURE(success)) return; + switch (SWAPW(coverage) & scfTypeMask) { case mstIndicRearrangement: diff --git a/src/share/native/sun/font/layout/MorphTables2.cpp b/src/share/native/sun/font/layout/MorphTables2.cpp index 33cbdeea7409154dfba04a8065b4c9e6ba3fa321..ff69cb9a41e184b952b55784911d2f91bae00ffb 100644 --- a/src/share/native/sun/font/layout/MorphTables2.cpp +++ b/src/share/native/sun/font/layout/MorphTables2.cpp @@ -197,6 +197,7 @@ void MorphTableHeader2::process(const LEReferenceTo &base, LE return; } subtableHeader.addOffset(length, success); // Don't addOffset for the last entry. + if (LE_FAILURE(success)) break; } le_uint32 coverage = SWAPL(subtableHeader->coverage); FeatureFlags subtableFeatures = SWAPL(subtableHeader->subtableFeatures); @@ -212,6 +213,8 @@ void MorphSubtableHeader2::process(const LEReferenceTo &ba { SubtableProcessor2 *processor = NULL; + if (LE_FAILURE(success)) return; + switch (SWAPL(coverage) & scfTypeMask2) { case mstIndicRearrangement: diff --git a/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp b/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp index f0cb95d80c5195cc7152eb66cc3b075411d85203..a8b8d0c64c6fb8003b650e897fbfda9780a73fe9 100644 --- a/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp +++ b/src/share/native/sun/font/layout/SegmentArrayProcessor.cpp @@ -63,6 +63,8 @@ void SegmentArrayProcessor::process(LEGlyphStorage &glyphStorage, LEErrorCode &s le_int32 glyphCount = glyphStorage.getGlyphCount(); le_int32 glyph; + if (LE_FAILURE(success)) return; + for (glyph = 0; glyph < glyphCount; glyph += 1) { LEGlyphID thisGlyph = glyphStorage[glyph]; const LookupSegment *lookupSegment = segmentArrayLookupTable->lookupSegment(segmentArrayLookupTable, segments, thisGlyph, success); diff --git a/src/share/native/sun/font/layout/SegmentArrayProcessor2.cpp b/src/share/native/sun/font/layout/SegmentArrayProcessor2.cpp index 6526f270ef8c408894a3bc636d146f3249b55019..89222a0cdf0bcc68f6ae6919ed4b5f2b3817679a 100644 --- a/src/share/native/sun/font/layout/SegmentArrayProcessor2.cpp +++ b/src/share/native/sun/font/layout/SegmentArrayProcessor2.cpp @@ -63,6 +63,8 @@ void SegmentArrayProcessor2::process(LEGlyphStorage &glyphStorage, LEErrorCode & le_int32 glyphCount = glyphStorage.getGlyphCount(); le_int32 glyph; + if (LE_FAILURE(success)) return; + for (glyph = 0; glyph < glyphCount; glyph += 1) { LEGlyphID thisGlyph = glyphStorage[glyph]; // lookupSegment already range checked by lookupSegment() function. diff --git a/src/share/native/sun/font/layout/SegmentSingleProcessor2.cpp b/src/share/native/sun/font/layout/SegmentSingleProcessor2.cpp index e1857cd4c5ee4a5c1733d435709ef41f6cf4302e..557278351801a37e112132d6b0040199d712fc91 100644 --- a/src/share/native/sun/font/layout/SegmentSingleProcessor2.cpp +++ b/src/share/native/sun/font/layout/SegmentSingleProcessor2.cpp @@ -64,6 +64,8 @@ void SegmentSingleProcessor2::process(LEGlyphStorage &glyphStorage, LEErrorCode le_int32 glyphCount = glyphStorage.getGlyphCount(); le_int32 glyph; + if (LE_FAILURE(success)) return; + for (glyph = 0; glyph < glyphCount; glyph += 1) { LEGlyphID thisGlyph = glyphStorage[glyph]; const LookupSegment *lookupSegment = segmentSingleLookupTable->lookupSegment(segmentSingleLookupTable, segments, thisGlyph, success); diff --git a/src/share/native/sun/font/layout/SimpleArrayProcessor2.cpp b/src/share/native/sun/font/layout/SimpleArrayProcessor2.cpp index 292c0a22e552b68ae506ee7f8c140cbb4544d93d..fb1b7b7eeaeb8045d3ba9904c94dd0f3d764f8cb 100644 --- a/src/share/native/sun/font/layout/SimpleArrayProcessor2.cpp +++ b/src/share/native/sun/font/layout/SimpleArrayProcessor2.cpp @@ -61,10 +61,11 @@ SimpleArrayProcessor2::~SimpleArrayProcessor2() void SimpleArrayProcessor2::process(LEGlyphStorage &glyphStorage, LEErrorCode &success) { - if (LE_FAILURE(success)) return; le_int32 glyphCount = glyphStorage.getGlyphCount(); le_int32 glyph; + if (LE_FAILURE(success)) return; + for (glyph = 0; glyph < glyphCount; glyph += 1) { LEGlyphID thisGlyph = glyphStorage[glyph]; if (LE_GET_GLYPH(thisGlyph) < 0xFFFF) { diff --git a/src/share/native/sun/font/layout/SingleTableProcessor.cpp b/src/share/native/sun/font/layout/SingleTableProcessor.cpp index dd44276f4a499df829438cb3fc0160d58863c2b4..e7c7c868bebc5d57ab1a97afab3aa9f20d7e6a99 100644 --- a/src/share/native/sun/font/layout/SingleTableProcessor.cpp +++ b/src/share/native/sun/font/layout/SingleTableProcessor.cpp @@ -63,6 +63,8 @@ void SingleTableProcessor::process(LEGlyphStorage &glyphStorage, LEErrorCode &su le_int32 glyph; le_int32 glyphCount = glyphStorage.getGlyphCount(); + if (LE_FAILURE(success)) return; + for (glyph = 0; glyph < glyphCount; glyph += 1) { const LookupSingle *lookupSingle = singleTableLookupTable->lookupSingle(singleTableLookupTable, entries, glyphStorage[glyph], success); diff --git a/test/java/rmi/testlibrary/TestLibrary.java b/test/java/rmi/testlibrary/TestLibrary.java index 8c28b8994abbac6be8eedf1e693a989ba127909e..67678629e91b3eef4df67cb44feb8547be3e568a 100644 --- a/test/java/rmi/testlibrary/TestLibrary.java +++ b/test/java/rmi/testlibrary/TestLibrary.java @@ -382,6 +382,16 @@ public class TestLibrary { return LocateRegistry.createRegistry(getUnusedRandomPort()); } + /** + * Creates an RMI {@link Registry} on an ephemeral port. + * + * @returns an RMI Registry + * @throws RemoteException if there was a problem creating a Registry. + */ + public static Registry createRegistryOnEphemeralPort() throws RemoteException { + return LocateRegistry.createRegistry(0); + } + /** * Returns the port number the RMI {@link Registry} is running on. * diff --git a/test/java/rmi/transport/pinClientSocketFactory/PinClientSocketFactory.java b/test/java/rmi/transport/pinClientSocketFactory/PinClientSocketFactory.java index 99357ffdb0bccf4cd91969129cf6f7550abfa4a6..51dc4c849b4602a171b25f119a666a7a534eb52a 100644 --- a/test/java/rmi/transport/pinClientSocketFactory/PinClientSocketFactory.java +++ b/test/java/rmi/transport/pinClientSocketFactory/PinClientSocketFactory.java @@ -58,7 +58,6 @@ import java.util.concurrent.atomic.AtomicInteger; public class PinClientSocketFactory { - private static final int PORT = TestLibrary.getUnusedRandomPort(); private static final int SESSIONS = 50; public interface Factory extends Remote { @@ -96,10 +95,13 @@ public class PinClientSocketFactory { } UnicastRemoteObject.unexportObject(factoryImpl, true); - Registry registryImpl = LocateRegistry.createRegistry(PORT); + Registry registryImpl = TestLibrary.createRegistryOnEphemeralPort(); + int port = TestLibrary.getRegistryPort(registryImpl); + System.out.println("Registry listening on port " + port); + CSF csf = new CSF(); Reference registryRef = new WeakReference(csf); - Registry registryStub = LocateRegistry.getRegistry("", PORT, csf); + Registry registryStub = LocateRegistry.getRegistry("", port, csf); csf = null; registryStub.list(); registryStub = null;