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

Commit 67802977 authored by Andreas Huber's avatar Andreas Huber
Browse files

Fix potential memory corruption in NuCachedSource2.

Change-Id: Ia6bd2d4966287228a3ac1b067ee1f1ccad965dbb
related-to-bug: 4354845
parent 89dc0dff
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -450,6 +450,11 @@ ssize_t NuCachedSource2::readInternal(off64_t offset, void *data, size_t size) {
        }

        size_t avail = mCache->totalSize() - delta;

        if (avail > size) {
            avail = size;
        }

        mCache->copy(delta, data, avail);

        return avail;