Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Side by Side Diff: patches/canonicalize.patch

Issue 8822005: Fix buffer overflow in _canonicalize. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/icu46/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « README.chromium ('k') | source/common/uloc.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 Index: source/common/uloc.c
2 ===================================================================
3 --- source/common/uloc.c (revision 113138)
4 +++ source/common/uloc.c (working copy)
5 @@ -1797,7 +1797,7 @@
6 int32_t variantLen = _deleteVariant(variant, uprv_min(variantSi ze, (nameCapacity-len)), variantToCompare, n);
7 len -= variantLen;
8 if (variantLen > 0) {
9 - if (name[len-1] == '_') { /* delete trailing '_' */
10 + if (len > 0 && name[len-1] == '_') { /* delete trailing '_' */
11 --len;
12 }
13 addKeyword = VARIANT_MAP[j].keyword;
14 @@ -1805,7 +1805,7 @@
15 break;
16 }
17 }
18 - if (name[len-1] == '_') { /* delete trailing '_' */
19 + if (len > 0 && len <= nameCapacity && name[len-1] == '_') { /* dele te trailing '_' */
20 --len;
21 }
22 }
OLDNEW
« no previous file with comments | « README.chromium ('k') | source/common/uloc.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698