Fix potential decrypt src pointer overflow. am: c3a24e6c86
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/13421305 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I243e7a6e4ea799af9759be2ee41f9d9ff7805f0e
This commit is contained in:
@@ -192,7 +192,11 @@ Return<void> WVCryptoPlugin::decrypt_1_2(
|
||||
return Void();
|
||||
}
|
||||
|
||||
if (source.offset + offset + source.size > sourceBase->getSize()) {
|
||||
size_t totalSrcSize = 0;
|
||||
if (__builtin_add_overflow(source.offset, offset, &totalSrcSize) ||
|
||||
__builtin_add_overflow(totalSrcSize, source.size, &totalSrcSize) ||
|
||||
totalSrcSize > sourceBase->getSize()) {
|
||||
android_errorWriteLog(0x534e4554, "176496160");
|
||||
_hidl_cb(Status_V1_2::ERROR_DRM_CANNOT_HANDLE, 0, "invalid buffer size");
|
||||
return Void();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user