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

Commit 198eff02 authored by Marco Nelissen's avatar Marco Nelissen Committed by Michael Bestas
Browse files

Clear allocation to avoid info leak

Bug: 26914474
Change-Id: Ie1a86e86d78058d041149fe599a4996e7f8185cf
(cherry picked from commit f7a38820)
parent 6911d186
Loading
Loading
Loading
Loading
+32 −27
Original line number Diff line number Diff line
@@ -704,10 +704,13 @@ status_t BnOMX::onTransact(

            size_t size = data.readInt32();

            void *params = malloc(size);
            data.read(params, size);

            status_t err;
            status_t err = NO_MEMORY;
            void *params = calloc(size, 1);
            if (params) {
                err = data.read(params, size);
                if (err != OK) {
                    android_errorWriteLog(0x534e4554, "26914474");
                } else {
                    switch (code) {
                        case GET_PARAMETER:
                            err = getParameter(node, index, params, size);
@@ -733,6 +736,8 @@ status_t BnOMX::onTransact(
                        default:
                            TRESPASS();
                    }
                }
            }

            reply->writeInt32(err);