diff options
| author | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-02-06 00:43:29 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-02-06 00:43:29 +0000 |
| commit | 92b34e48ba6be4431351618f6409c52e51938545 (patch) | |
| tree | 98a7b0ddc85d5f71ef7d8aa440d34f95da46b737 /drm | |
| parent | 7cf46ee5e75bc78fbaa8ec91bfb67d3b5e12019e (diff) | |
| parent | 86021896f0811062a47001b20f14bc29badf68e3 (diff) | |
| download | frameworks_av-92b34e48ba6be4431351618f6409c52e51938545.tar.gz frameworks_av-92b34e48ba6be4431351618f6409c52e51938545.tar.bz2 frameworks_av-92b34e48ba6be4431351618f6409c52e51938545.zip | |
BnCrypto: fix use-before-init in CREATE_PLUGIN am: 51aa200376 am: aca92198a1 am: f0791037c1 am: df156dc766 am: 86021896f0
Change-Id: Ia97c658b54e517e1bdbd911bba644e458a193e01
Diffstat (limited to 'drm')
| -rw-r--r-- | drm/libmediadrm/ICrypto.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drm/libmediadrm/ICrypto.cpp b/drm/libmediadrm/ICrypto.cpp index a2594aa2d8..4707593b27 100644 --- a/drm/libmediadrm/ICrypto.cpp +++ b/drm/libmediadrm/ICrypto.cpp @@ -264,8 +264,12 @@ status_t BnCrypto::onTransact( { CHECK_INTERFACE(ICrypto, data, reply); - uint8_t uuid[16]; - data.read(uuid, sizeof(uuid)); + uint8_t uuid[16] = {0}; + if (data.read(uuid, sizeof(uuid)) != NO_ERROR) { + android_errorWriteLog(0x534e4554, "144767096"); + reply->writeInt32(BAD_VALUE); + return OK; + } size_t opaqueSize = data.readInt32(); void *opaqueData = NULL; @@ -281,6 +285,11 @@ status_t BnCrypto::onTransact( } data.read(opaqueData, opaqueSize); + if (data.read(opaqueData, opaqueSize) != NO_ERROR) { + android_errorWriteLog(0x534e4554, "144767096"); + reply->writeInt32(BAD_VALUE); + return OK; + } reply->writeInt32(createPlugin(uuid, opaqueData, opaqueSize)); free(opaqueData); |
