summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJeff Tinker <jtinker@google.com>2015-12-10 00:41:15 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-12-10 00:41:15 +0000
commit3f05f30117c9ad8a0956f31431ddd5fbc07fbd99 (patch)
tree2880b244f9b1ec44b7d243855b0dc0a0d58df78a /media
parent0e7c8849a934b0785adde3fd2ca26cc5d54517ee (diff)
parentf797a48b4ceaef56402ecd942ccdebab394daad0 (diff)
downloadframeworks_av-3f05f30117c9ad8a0956f31431ddd5fbc07fbd99.zip
frameworks_av-3f05f30117c9ad8a0956f31431ddd5fbc07fbd99.tar.gz
frameworks_av-3f05f30117c9ad8a0956f31431ddd5fbc07fbd99.tar.bz2
Merge "Fix security vulnerability in ICrypto DO NOT MERGE" into mnc-dev am: 89bec04cf8
am: f797a48b4c * commit 'f797a48b4ceaef56402ecd942ccdebab394daad0': Fix security vulnerability in ICrypto DO NOT MERGE
Diffstat (limited to 'media')
-rw-r--r--media/libmedia/ICrypto.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/media/libmedia/ICrypto.cpp b/media/libmedia/ICrypto.cpp
index a398ff7..22f8af7 100644
--- a/media/libmedia/ICrypto.cpp
+++ b/media/libmedia/ICrypto.cpp
@@ -321,7 +321,9 @@ status_t BnCrypto::onTransact(
if (overflow || sumSubsampleSizes != totalSize) {
result = -EINVAL;
- } else if (offset + totalSize > sharedBuffer->size()) {
+ } else if (totalSize > sharedBuffer->size()) {
+ result = -EINVAL;
+ } else if ((size_t)offset > sharedBuffer->size() - totalSize) {
result = -EINVAL;
} else {
result = decrypt(