diff options
author | Naveen Leekha <leekha@google.com> | 2015-09-22 17:58:21 -0700 |
---|---|---|
committer | Jessica Wagantall <jwagantall@cyngn.com> | 2015-11-02 15:58:29 -0800 |
commit | 571412c03beac4a72f10be3efae8c51e31a8d1fd (patch) | |
tree | 12fec263b93ec095664e253c0993cfc5f93bc1ae | |
parent | e10563b2d8d6ec045f38ac1ec2490abe3e72a6bd (diff) | |
download | android_frameworks_native-571412c03beac4a72f10be3efae8c51e31a8d1fd.tar.gz android_frameworks_native-571412c03beac4a72f10be3efae8c51e31a8d1fd.tar.bz2 android_frameworks_native-571412c03beac4a72f10be3efae8c51e31a8d1fd.zip |
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
12ba0f57d028a9c8f4eb3afddc326b70677d1e0c )
For b/23696300
Change-Id: I665212d10da56f0803b5bb772d14c77e632ba2ab
(cherry picked from commit c1e6fbb52c3f85cc7610d1d07d12be38f70b4ed4)
Ticket: CYNGNOS-1189
-rw-r--r-- | libs/gui/IGraphicBufferProducer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/gui/IGraphicBufferProducer.cpp b/libs/gui/IGraphicBufferProducer.cpp index a37a4a421..518fd6b92 100644 --- a/libs/gui/IGraphicBufferProducer.cpp +++ b/libs/gui/IGraphicBufferProducer.cpp @@ -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); |