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

Unified Diff: src/language-matcher.cc

Issue 8570009: Fix out of bounds array assignment. (Closed) Base URL: http://v8-i18n.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/language-matcher.cc
===================================================================
--- src/language-matcher.cc (revision 6)
+++ src/language-matcher.cc (working copy)
@@ -187,11 +187,11 @@
// uloc_forLanguageTag has a bug where long extension can crash the code.
// We need to check if extension part of language id conforms to the length.
// ICU bug: http://bugs.icu-project.org/trac/ticket/8519
- const char* extension = strstr(locale_id, "-u-");
+ const char* extension = strstr(locale, "-u-");
if (extension != NULL &&
strlen(extension) > ULOC_KEYWORD_AND_VALUES_CAPACITY) {
// Truncate to get non-crashing string, but still preserve base language.
- int base_length = strlen(locale_id) - strlen(extension);
+ int base_length = strlen(locale) - strlen(extension);
locale[base_length] = '\0';
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698