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

Commit 3c1515f4 authored by Lee Shombert's avatar Lee Shombert Committed by Android Build Coastguard Worker
Browse files

Zero-initialize CursorWindow buffer

Zero-initialize mData in CursorWindow::create().  The caller might not
fully fill that buffer before sending it to the remote end.  It is not
necessary to zero-initialize in CursorWindow::createFromParcel(),
since the buffer is immediately filled from the far end.

Flag: EXEMPT bug-fix
Bug: 309407957
Test: atest
 * libandroidfw_tests
 * FrameworksCoreTests:android.database
 * CtsDatabaseTestCases
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:9dc64621d896d05fcb0e6f45792a307fde130823)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:cd4d9f2a2fefdb4c63dc6ab712fe9e4ec27dc9e6)
Merged-In: I755240b0e3ba185c01036a5e00c8785d2e1ac11a
Change-Id: I755240b0e3ba185c01036a5e00c8785d2e1ac11a
parent 37a27243
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ status_t CursorWindow::create(const String8 &name, size_t inflatedSize, CursorWi
    window->mName = name;
    window->mSize = std::min(kInlineSize, inflatedSize);
    window->mInflatedSize = inflatedSize;
    window->mData = malloc(window->mSize);
    window->mData = calloc(window->mSize, 1);
    if (!window->mData) goto fail;
    window->mReadOnly = false;