Reject bad ResXMLTree::setTo calls

Bug: http://code.google.com/p/android/issues/detail?id=21838
Change-Id: I1092499906f0cafe5a3c42ab2579edf3763cedb7
This commit is contained in:
Kenny Root
2012-10-10 10:23:47 -07:00
parent cee1124052
commit 32d6aef11a

View File

@@ -1209,6 +1209,10 @@ status_t ResXMLTree::setTo(const void* data, size_t size, bool copyData)
uninit();
mEventCode = START_DOCUMENT;
if (!data || !size) {
return (mError=BAD_TYPE);
}
if (copyData) {
mOwnedData = malloc(size);
if (mOwnedData == NULL) {