summaryrefslogtreecommitdiffstats
path: root/drm
diff options
context:
space:
mode:
authorJeff Tinker <jtinker@google.com>2015-09-16 18:33:58 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-16 18:33:58 +0000
commit38281f1cbcd4804095828f19b7954d5219560fcd (patch)
tree05792b47baefede2d31c3b26fa6a76ab2dba32e3 /drm
parent9860dcdf427d70e6aef4ce082be40a5459c466f4 (diff)
parentd386c5be9505d2db24048a6e08ab714f2151dac2 (diff)
downloadframeworks_av-38281f1cbcd4804095828f19b7954d5219560fcd.zip
frameworks_av-38281f1cbcd4804095828f19b7954d5219560fcd.tar.gz
frameworks_av-38281f1cbcd4804095828f19b7954d5219560fcd.tar.bz2
am d386c5be: Merge "Fix heap data leak vulnerability" into klp-dev
* commit 'd386c5be9505d2db24048a6e08ab714f2151dac2': Fix heap data leak vulnerability
Diffstat (limited to 'drm')
-rw-r--r--drm/common/IDrmManagerService.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/drm/common/IDrmManagerService.cpp b/drm/common/IDrmManagerService.cpp
index db41e0b..c235201 100644
--- a/drm/common/IDrmManagerService.cpp
+++ b/drm/common/IDrmManagerService.cpp
@@ -741,9 +741,11 @@ status_t BpDrmManagerService::decrypt(
const status_t status = reply.readInt32();
ALOGV("Return value of decrypt() is %d", status);
- const int size = reply.readInt32();
- (*decBuffer)->length = size;
- reply.read((void *)(*decBuffer)->data, size);
+ if (status == NO_ERROR) {
+ const int size = reply.readInt32();
+ (*decBuffer)->length = size;
+ reply.read((void *)(*decBuffer)->data, size);
+ }
return status;
}
@@ -1438,9 +1440,11 @@ status_t BnDrmManagerService::onTransact(
reply->writeInt32(status);
- const int size = decBuffer->length;
- reply->writeInt32(size);
- reply->write(decBuffer->data, size);
+ if (status == NO_ERROR) {
+ const int size = decBuffer->length;
+ reply->writeInt32(size);
+ reply->write(decBuffer->data, size);
+ }
clearDecryptHandle(&handle);
delete encBuffer; encBuffer = NULL;