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

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