diff options
author | Daniel Norman <danielnorman@google.com> | 2021-02-08 11:11:06 -0800 |
---|---|---|
committer | Daniel Norman <danielnorman@google.com> | 2021-02-08 14:07:55 -0800 |
commit | f86b976dba9b016816efa57156e791fffd498d64 (patch) | |
tree | 62e68f2885e6a7a73bf3386e8459f8fe98528ade /drm/1.0/default/CryptoPlugin.cpp | |
parent | a0da4d07b75fa61fcb4f5648ba304cbf4ac50f6a (diff) | |
parent | 7fd5ae363319c3d8fa9128c39075ea82799989ab (diff) |
Merge SP1A.210208.001
Change-Id: I0c596171de3bcead62935db7388b784e55444080
Diffstat (limited to 'drm/1.0/default/CryptoPlugin.cpp')
-rw-r--r-- | drm/1.0/default/CryptoPlugin.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drm/1.0/default/CryptoPlugin.cpp b/drm/1.0/default/CryptoPlugin.cpp index 2db360765b..e6d4e8447b 100644 --- a/drm/1.0/default/CryptoPlugin.cpp +++ b/drm/1.0/default/CryptoPlugin.cpp @@ -124,7 +124,11 @@ namespace implementation { return Void(); } - if (source.offset + offset + source.size > sourceBase->getSize()) { + size_t totalSize = 0; + if (__builtin_add_overflow(source.offset, offset, &totalSize) || + __builtin_add_overflow(totalSize, source.size, &totalSize) || + totalSize > sourceBase->getSize()) { + android_errorWriteLog(0x534e4554, "176496160"); _hidl_cb(Status::ERROR_DRM_CANNOT_HANDLE, 0, "invalid buffer size"); return Void(); } |