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

Commit 2777af5c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix the null data ptr in CursorWindow" into main

parents b7ecf56b 32591038
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -188,9 +188,9 @@ status_t CursorWindow::createFromParcel(Parcel* parcel, CursorWindow** outWindow
            goto fail_silent;
        }

        if (window->mSize > 0) {
        window->mData = malloc(window->mSize);
        if (!window->mData) goto fail;
        if (window->mSize > 0) {
            if (parcel->read(window->mData, window->mSize)) goto fail;
        }
    }
+5 −0
Original line number Diff line number Diff line
@@ -154,6 +154,11 @@ private:
    String8 mName;
    std::optional<android::base::MappedFile> mMappedFile;
    int mAshmemFd = -1;
    /**
     * Pointer to the start of the memory region, either mmap'ed from ashmem, or malloc'ed.
     * Must not be null after full initialization even for an empty window, as many getters perform
     * pointer arithmetic on it without null checks for performance reasons.
     */
    void* mData = nullptr;
    /**
     * Pointer to the first FieldSlot, used to optimize the extremely