changeset 10126:006f772bbc7e

8042855: [parfait] Potential null pointer dereference in IndicLayoutEngine.cpp Reviewed-by: bae, srl
author prr
date Thu, 22 May 2014 13:54:08 -0700
parents 6d828581eaee
children be332c33c5a0
files src/share/native/sun/font/layout/IndicLayoutEngine.cpp src/share/native/sun/font/layout/IndicReordering.cpp src/share/native/sun/font/layout/IndicReordering.h
diffstat 3 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/font/layout/IndicLayoutEngine.cpp	Thu May 22 21:05:30 2014 +0400
+++ b/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);
--- a/src/share/native/sun/font/layout/IndicReordering.cpp	Thu May 22 21:05:30 2014 +0400
+++ b/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);
--- a/src/share/native/sun/font/layout/IndicReordering.h	Thu May 22 21:05:30 2014 +0400
+++ b/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);