Merge changes from topic "am-1ab9514f-fd12-4093-b1cb-a77e9f0419c9" into oc-dev
am: 46fc48f57e
Change-Id: I85ba0993926fbd9a61525e35e411887130b3c5aa
This commit is contained in:
committed by
android-build-merger
commit
b39e49d52c
@@ -813,7 +813,13 @@ const char* ResStringPool::string8At(size_t idx, size_t* outLen) const
|
|||||||
*outLen = encLen;
|
*outLen = encLen;
|
||||||
|
|
||||||
if ((uint32_t)(str+encLen-strings) < mStringPoolSize) {
|
if ((uint32_t)(str+encLen-strings) < mStringPoolSize) {
|
||||||
return (const char*)str;
|
// Reject malformed (non null-terminated) strings
|
||||||
|
if (str[encLen] != 0x00) {
|
||||||
|
ALOGW("Bad string block: string #%d is not null-terminated",
|
||||||
|
(int)idx);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return (const char*)str;
|
||||||
} else {
|
} else {
|
||||||
ALOGW("Bad string block: string #%d extends to %d, past end at %d\n",
|
ALOGW("Bad string block: string #%d extends to %d, past end at %d\n",
|
||||||
(int)idx, (int)(str+encLen-strings), (int)mStringPoolSize);
|
(int)idx, (int)(str+encLen-strings), (int)mStringPoolSize);
|
||||||
|
|||||||
Reference in New Issue
Block a user