From: Jungshik Shin Date: Wed, 15 Feb 2012 00:19:17 +0000 (+0000) Subject: ICU-9114 buffer overflow in _getKeyword() in uloc.cpp X-Git-Tag: milestone-59-0-1~4051 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5dd029e6e5a425b5243b467b08780dd9841a9681;p=icu ICU-9114 buffer overflow in _getKeyword() in uloc.cpp X-SVN-Rev: 31396 --- diff --git a/icu4c/source/common/uloc.cpp b/icu4c/source/common/uloc.cpp index 247b15acac0..25caee1b564 100644 --- a/icu4c/source/common/uloc.cpp +++ b/icu4c/source/common/uloc.cpp @@ -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;