mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 05:49:27 +00:00
[VTS 2.3] Add length check before reading blob
Adding a length check prevents the read() from reading outside the bounds and prevents OOB crash. Test: atest VtsHalGraphicsComposerV2_3TargetTest && atest VtsHalGraphicsComposerV2_4TargetTest BUG: 252764300 Change-Id: I6231e340a925127f9c32ccb76768286f7292df58 Merged-In: I6231e340a925127f9c32ccb76768286f7292df58
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user