# HG changeset patch # User prr # Date 1400792048 25200 # Node ID 2b07b28079a153173ceeeb88790c1f0523fd2e72 # Parent d527cc827d7db4580364794609ddb8b300f8692a 8042855: [parfait] Potential null pointer dereference in IndicLayoutEngine.cpp Reviewed-by: bae, srl diff -r d527cc827d7d -r 2b07b28079a1 jdk/src/share/native/sun/font/layout/IndicLayoutEngine.cpp --- a/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.cpp Thu May 22 21:05:30 2014 +0400 +++ b/jdk/src/share/native/sun/font/layout/IndicLayoutEngine.cpp Thu May 22 13:54:08 2014 -0700 @@ -151,7 +151,7 @@ le_int32 outCharCount; if (fVersion2) { _LETRACE("v2process"); - outCharCount = IndicReordering::v2process(&chars[offset], count, fScriptCode, outChars, glyphStorage); + outCharCount = IndicReordering::v2process(&chars[offset], count, fScriptCode, outChars, glyphStorage, success); } else { _LETRACE("reorder"); outCharCount = IndicReordering::reorder(&chars[offset], count, fScriptCode, outChars, glyphStorage, &fMPreFixups, success); diff -r d527cc827d7d -r 2b07b28079a1 jdk/src/share/native/sun/font/layout/IndicReordering.cpp --- a/jdk/src/share/native/sun/font/layout/IndicReordering.cpp Thu May 22 21:05:30 2014 +0400 +++ b/jdk/src/share/native/sun/font/layout/IndicReordering.cpp Thu May 22 13:54:08 2014 -0700 @@ -1096,9 +1096,13 @@ le_int32 IndicReordering::v2process(const LEUnicode *chars, le_int32 charCount, le_int32 scriptCode, - LEUnicode *outChars, LEGlyphStorage &glyphStorage) + LEUnicode *outChars, LEGlyphStorage &glyphStorage, LEErrorCode& success) { const IndicClassTable *classTable = IndicClassTable::getScriptClassTable(scriptCode); + if (classTable == NULL) { + success = LE_MEMORY_ALLOCATION_ERROR; + return 0; + } DynamicProperties dynProps[INDIC_BLOCK_SIZE]; IndicReordering::getDynamicProperties(dynProps,classTable); diff -r d527cc827d7d -r 2b07b28079a1 jdk/src/share/native/sun/font/layout/IndicReordering.h --- a/jdk/src/share/native/sun/font/layout/IndicReordering.h Thu May 22 21:05:30 2014 +0400 +++ b/jdk/src/share/native/sun/font/layout/IndicReordering.h Thu May 22 13:54:08 2014 -0700 @@ -181,7 +181,7 @@ static void adjustMPres(MPreFixups *mpreFixups, LEGlyphStorage &glyphStorage, LEErrorCode& success); static le_int32 v2process(const LEUnicode *theChars, le_int32 charCount, le_int32 scriptCode, - LEUnicode *outChars, LEGlyphStorage &glyphStorage); + LEUnicode *outChars, LEGlyphStorage &glyphStorage, LEErrorCode& success); static const FeatureMap *getFeatureMap(le_int32 &count);