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

Commit 571412c0 authored by Naveen Leekha's avatar Naveen Leekha Committed by Jessica Wagantall
Browse files

Initialize local variables to avoid data leak

The uninitialized local variables pick up
whatever the memory content was there on stack.
This data gets sent to the remote process in
case of a failed transaction, which is a security
issue. Fixed.

(Manual merge of master change
 12ba0f57 )

For b/23696300

Change-Id: I665212d10da56f0803b5bb772d14c77e632ba2ab
(cherry picked from commit c1e6fbb5)
Ticket: CYNGNOS-1189
parent e10563b2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -322,7 +322,7 @@ status_t BnGraphicBufferProducer::onTransact(
            uint32_t h      = data.readInt32();
            uint32_t format = data.readInt32();
            uint32_t usage  = data.readInt32();
            int buf;
            int buf = 0;
            sp<Fence> fence;
            int result = dequeueBuffer(&buf, &fence, async, w, h, format, usage);
            reply->writeInt32(buf);
@@ -389,7 +389,7 @@ status_t BnGraphicBufferProducer::onTransact(
        } break;
        case QUERY: {
            CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
            int value;
            int value = 0;
            int what = data.readInt32();
            int res = query(what, &value);
            reply->writeInt32(value);