summarylogtreecommitdiffstats
path: root/CVE-2011-4599.patch
blob: 0eabb80ab8c790241d774a4eaead05f8fc81b8e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Index: icu-4.8.1.1/source/common/uloc.c
===================================================================
--- icu-4.8.1.1.orig/source/common/uloc.c	2011-10-18 19:12:40.000000000 -0400
+++ icu-4.8.1.1/source/common/uloc.c	2012-01-21 19:42:18.087577138 -0500
@@ -1797,7 +1797,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;
@@ -1805,7 +1805,7 @@
                     break;
                 }
             }
-            if (name[len-1] == '_') { /* delete trailing '_' */
+            if (len > 0 && len <= nameCapacity && name[len-1] == '_') { /* delete trailing '_' */
                 --len;
             }
         }