Skip to content

Commit 8263431

Browse files
krutonGerrit Code Review
authored andcommitted
Merge "Reject bad ResXMLTree::setTo calls"
2 parents cee1124 + 32d6aef commit 8263431

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)