diff options
author | Jeff Tinker <jtinker@google.com> | 2015-09-16 18:40:49 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-09-16 18:40:49 +0000 |
commit | d61dbb36a673a8278eb7d63e53215b2cff804f4b (patch) | |
tree | 6efdac7ae1fbd0c061936214afe6c5111c0a8a31 /drm/common | |
parent | cc0942d0c2a57c5025063c62689ee01b39736dc2 (diff) | |
parent | 38281f1cbcd4804095828f19b7954d5219560fcd (diff) | |
download | frameworks_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.cpp | 16 |
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; |