diff options
author | 2014-10-02 07:01:55 +0000 | |
---|---|---|
committer | 2014-10-02 07:01:55 +0000 | |
commit | 152d9aae631381ea28f5701168d372a1486a7502 (patch) | |
tree | 014ea3e33d0ce614683ffffaf7b916c9b82069ae /tools/aapt/AaptAssets.cpp | |
parent | 1dcc75b2dbaef7c3bb3410187bf38cabca0d1aea (diff) | |
parent | 316296511bf12c4e14dfb6f54731d1a515114abf (diff) |
am 31629651: Merge "Frameworks/base: Fix more aapt issues"
* commit '316296511bf12c4e14dfb6f54731d1a515114abf':
Frameworks/base: Fix more aapt issues
Diffstat (limited to 'tools/aapt/AaptAssets.cpp')
-rw-r--r-- | tools/aapt/AaptAssets.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp index d8e2de659f48..c262b00df95e 100644 --- a/tools/aapt/AaptAssets.cpp +++ b/tools/aapt/AaptAssets.cpp @@ -192,7 +192,7 @@ inline bool isNumber(const String8& string) { void AaptLocaleValue::setLanguage(const char* languageChars) { size_t i = 0; - while ((*languageChars) != '\0') { + while ((*languageChars) != '\0' && i < sizeof(language)/sizeof(language[0])) { language[i++] = tolower(*languageChars); languageChars++; } @@ -200,7 +200,7 @@ void AaptLocaleValue::setLanguage(const char* languageChars) { void AaptLocaleValue::setRegion(const char* regionChars) { size_t i = 0; - while ((*regionChars) != '\0') { + while ((*regionChars) != '\0' && i < sizeof(region)/sizeof(region[0])) { region[i++] = toupper(*regionChars); regionChars++; } @@ -208,7 +208,7 @@ void AaptLocaleValue::setRegion(const char* regionChars) { void AaptLocaleValue::setScript(const char* scriptChars) { size_t i = 0; - while ((*scriptChars) != '\0') { + while ((*scriptChars) != '\0' && i < sizeof(script)/sizeof(script[0])) { if (i == 0) { script[i++] = toupper(*scriptChars); } else { @@ -220,7 +220,7 @@ void AaptLocaleValue::setScript(const char* scriptChars) { void AaptLocaleValue::setVariant(const char* variantChars) { size_t i = 0; - while ((*variantChars) != '\0') { + while ((*variantChars) != '\0' && i < sizeof(variant)/sizeof(variant[0])) { variant[i++] = *variantChars; variantChars++; } |