Reject bad ResXMLTree::setTo calls
Bug: http://code.google.com/p/android/issues/detail?id=21838 Change-Id: I1092499906f0cafe5a3c42ab2579edf3763cedb7
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user