incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1214135 - /incubator/ooo/trunk/main/icu/icu4c-4_0_1-src.patch
Date Wed, 14 Dec 2011 10:11:36 GMT
Author: hdu
Date: Wed Dec 14 10:11:36 2011
New Revision: 1214135

URL: http://svn.apache.org/viewvc?rev=1214135&view=rev
Log:
check string acesses in ICU uloc.c

Modified:
    incubator/ooo/trunk/main/icu/icu4c-4_0_1-src.patch

Modified: incubator/ooo/trunk/main/icu/icu4c-4_0_1-src.patch
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/icu/icu4c-4_0_1-src.patch?rev=1214135&r1=1214134&r2=1214135&view=diff
==============================================================================
--- incubator/ooo/trunk/main/icu/icu4c-4_0_1-src.patch (original)
+++ incubator/ooo/trunk/main/icu/icu4c-4_0_1-src.patch Wed Dec 14 10:11:36 2011
@@ -245,3 +245,23 @@
      T_FileStream_writeLine(makefile, tmp);
  
      if(o->hadStdin == FALSE) { /* shortcut */
+--- misc/icu/source/common/uloc.c	2009-01-15 08:45:56.000000000 +0100
++++ misc/build/icu/source/common/uloc.c	2009-12-14 10:51:38.000000000 +0100
+@@ -1736,7 +1736,7 @@
+                 int32_t variantLen = _deleteVariant(variant, uprv_min(variantSize, (nameCapacity-len)),
variantToCompare, n);
+                 len -= variantLen;
+                 if (variantLen > 0) {
+-                    if (name[len-1] == '_') { /* delete trailing '_' */
++                    if (len > 0 && name[len-1] == '_') { /* delete trailing '_'
*/
+                         --len;
+                     }
+                     addKeyword = VARIANT_MAP[j].keyword;
+@@ -1744,7 +1744,7 @@
+                     break;
+                 }
+             }
+-            if (name[len-1] == '_') { /* delete trailing '_' */
++            if (len > 0 && name[len-1] == '_') { /* delete trailing '_' */
+                 --len;
+             }
+         }



Mime
View raw message