mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 21:37:44 +00:00
Fix potential decrypt src pointer overflow. am: c14f262876 am: 107233b3dd am: e289b4aa83
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/13472562 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I670648e6ef343ad17c332c44ac9c5a2f29f9071c
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user