Blame SOURCES/icu.rhbz1074549.CVE-2013-5907.patch

92ecab
92ecab
# erAck: resolves https://bugzilla.redhat.com/show_bug.cgi?id=1074549
92ecab
# Based on http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/rev/9d29c19f1de1
92ecab
# where a/src/share/native/sun/font/layout/LookupProcessor.cpp is
92ecab
# icu/source/layout/LookupProcessor.cpp
92ecab
# Adapted to LayoutEngine "patch" and subsequent patches.
92ecab
# Note that
92ecab
#@@ -246,7 +249,7 @@
92ecab
#-      featureReferences += SWAPW(featureTable->lookupCount);
92ecab
#+      featureReferences += SWAPW(requiredFeatureTable->lookupCount);
92ecab
# was already applied with icu.8800.freeserif.crash.patch that also added
92ecab
#+      if (requiredFeatureTable.isValid()) {
92ecab
# and is a slightly enhanced version of
92ecab
# https://ssl.icu-project.org/trac/ticket/8800 and/or
92ecab
# https://ssl.icu-project.org/trac/ticket/8320
92ecab
92ecab
--- prev.icu/source/layout/LookupProcessor.cpp	2014-03-11 20:46:53.288819882 +0100
92ecab
+++ icu/source/layout/LookupProcessor.cpp	2014-03-11 20:54:43.153370234 +0100
92ecab
@@ -113,7 +113,7 @@
92ecab
 le_int32 LookupProcessor::selectLookups(const LEReferenceTo<featuretable> &featureTable, FeatureMask featureMask, le_int32 order, LEErrorCode &success)
92ecab
 {
92ecab
   le_uint16 lookupCount = featureTable.isValid()? SWAPW(featureTable->lookupCount) : 0;
92ecab
-    le_int32  store = order;
92ecab
+    le_uint32  store = (le_uint32)order;
92ecab
     
92ecab
     LEReferenceToArrayOf<le_uint16> lookupListIndexArray(featureTable, success, featureTable->lookupListIndexArray, lookupCount);
92ecab
 
92ecab
@@ -122,6 +122,9 @@
92ecab
       if (lookupListIndex >= lookupSelectCount) {
92ecab
         continue;
92ecab
       }
92ecab
+      if (store >= lookupOrderCount) {
92ecab
+        continue;
92ecab
+      }
92ecab
       
92ecab
       lookupSelectArray[lookupListIndex] |= featureMask;
92ecab
       lookupOrderArray[store++] = lookupListIndex;