diff options
author | 2014-10-02 07:07:13 +0000 | |
---|---|---|
committer | 2014-10-02 07:07:13 +0000 | |
commit | e1b180e21e10e2cc18f3985c4e40cd32a605ac48 (patch) | |
tree | 90a769b9cac8715873e9b1364335e12c8abd2e50 /tools/aapt/AaptAssets.cpp | |
parent | 548bb3d3521eee5b9f34b2860c698cb0c5226e27 (diff) | |
parent | 152d9aae631381ea28f5701168d372a1486a7502 (diff) |
am 152d9aae: am 31629651: Merge "Frameworks/base: Fix more aapt issues"
* commit '152d9aae631381ea28f5701168d372a1486a7502':
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 364830d86bda..2849c84f1bb5 100644 --- a/tools/aapt/AaptAssets.cpp +++ b/tools/aapt/AaptAssets.cpp @@ -175,7 +175,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++; } @@ -183,7 +183,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++; } @@ -191,7 +191,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 { @@ -203,7 +203,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++; } |