summaryrefslogtreecommitdiffstats
path: root/drm/common
diff options
context:
space:
mode:
authorJeff Tinker <jtinker@google.com>2015-09-16 18:40:49 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-16 18:40:49 +0000
commitd61dbb36a673a8278eb7d63e53215b2cff804f4b (patch)
tree6efdac7ae1fbd0c061936214afe6c5111c0a8a31 /drm/common
parentcc0942d0c2a57c5025063c62689ee01b39736dc2 (diff)
parent38281f1cbcd4804095828f19b7954d5219560fcd (diff)
downloadframeworks_av-d61dbb36a673a8278eb7d63e53215b2cff804f4b.zip
frameworks_av-d61dbb36a673a8278eb7d63e53215b2cff804f4b.tar.gz
frameworks_av-d61dbb36a673a8278eb7d63e53215b2cff804f4b.tar.bz2
am 38281f1c: am d386c5be: Merge "Fix heap data leak vulnerability" into klp-dev
* commit '38281f1cbcd4804095828f19b7954d5219560fcd': Fix heap data leak vulnerability
Diffstat (limited to 'drm/common')
-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;