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

Commit 36b31c87 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "libmedia: add NULL check before accessing source and destination buffers."

parents 760d007b a04f6995
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -124,6 +124,14 @@ struct BpMediaHTTPConnection : public BpInterface<IMediaHTTPConnection> {
            ALOGE("got %zu, but memory has %zu", len, mMemory->size());
            return ERROR_OUT_OF_RANGE;
        }
        if(buffer == NULL) {
           ALOGE("readAt got a NULL buffer");
           return UNKNOWN_ERROR;
        }
        if (mMemory->pointer() == NULL) {
           ALOGE("readAt got a NULL mMemory->pointer()");
           return UNKNOWN_ERROR;
        }

        memcpy(buffer, mMemory->pointer(), len);