Merge "[VTS 2.3] Add length check before reading blob" into udc-dev am: a9d135cd14

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/23438943

Change-Id: I492cd7aa3aec59dc6af2385de5d3af6b9b1a887b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Ram Indani 2023-05-30 17:09:05 +00:00 committed by Automerger Merge Worker
commit b6ffd5c35d

View file

@ -82,7 +82,7 @@ class ComposerCommandEngine : public V2_2::hal::ComposerCommandEngine {
std::vector<IComposerClient::PerFrameMetadataBlob> metadata;
for (size_t i = 0; i < numBlobs; i++) {
for (size_t i = 0; i < numBlobs && length >= 2; i++) {
IComposerClient::PerFrameMetadataKey key =
static_cast<IComposerClient::PerFrameMetadataKey>(readSigned());
uint32_t blobSize = read();