Skip to content

Commit 32d6aef

Browse files
committed
Reject bad ResXMLTree::setTo calls
Bug: http://code.google.com/p/android/issues/detail?id=21838 Change-Id: I1092499906f0cafe5a3c42ab2579edf3763cedb7
1 parent cee1124 commit 32d6aef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libs/androidfw/ResourceTypes.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,10 @@ status_t ResXMLTree::setTo(const void* data, size_t size, bool copyData)
12091209
uninit();
12101210
mEventCode = START_DOCUMENT;
12111211

1212+
if (!data || !size) {
1213+
return (mError=BAD_TYPE);
1214+
}
1215+
12121216
if (copyData) {
12131217
mOwnedData = malloc(size);
12141218
if (mOwnedData == NULL) {

0 commit comments

Comments
 (0)