Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32d6aef1 authored by Kenny Root's avatar Kenny Root
Browse files

Reject bad ResXMLTree::setTo calls

Bug: http://code.google.com/p/android/issues/detail?id=21838
Change-Id: I1092499906f0cafe5a3c42ab2579edf3763cedb7
parent cee11240
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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) {