]> granicus.if.org Git - icu/commitdiff
ICU-9114 buffer overflow in _getKeyword() in uloc.cpp
authorJungshik Shin <jshin@chromium.org>
Wed, 15 Feb 2012 00:19:17 +0000 (00:19 +0000)
committerJungshik Shin <jshin@chromium.org>
Wed, 15 Feb 2012 00:19:17 +0000 (00:19 +0000)
X-SVN-Rev: 31396

icu4c/source/common/uloc.cpp

index 247b15acac0cc1b104fc460540e37b44c7f52137..25caee1b56459c935b566491446cf0329e075e73 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-*   Copyright (C) 1997-2011, International Business Machines
+*   Copyright (C) 1997-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 **********************************************************************
 *
@@ -706,7 +706,7 @@ _getKeywords(const char *localeID,
                 pos++;
             } else {
                 i = (int32_t)uprv_strlen(equalSign);
-                while(equalSign[i-1] == ' ') {
+                while(i && equalSign[i-1] == ' ') {
                     i--;
                 }
                 keywordList[numKeywords].valueLen = i;