From 1dccf3f15a9033ff3c6067bedfeac4a2c16bb99c Mon Sep 17 00:00:00 2001 From: vit9696 Date: Sat, 25 Jan 2020 10:54:06 +0300 Subject: [PATCH] Fix CPD signature verification --- common/meparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/meparser.cpp b/common/meparser.cpp index 25d1380..bd04256 100755 --- a/common/meparser.cpp +++ b/common/meparser.cpp @@ -283,7 +283,7 @@ make_partition_table_consistent: // Add tree item UINT8 type = Subtypes::CodeFptPartition + partitions[i].ptEntry.Type; partitionIndex = model->addItem(partitions[i].ptEntry.Offset, Types::FptPartition, type, name, UString(), info, UByteArray(), partition, UByteArray(), Fixed, parent); - if (type == Subtypes::CodeFptPartition) { + if (type == Subtypes::CodeFptPartition && partition.size() >= sizeof(UINT32) && readUnaligned((const UINT32*)partition.constData()) == CPD_SIGNATURE) { // Parse code partition contents UModelIndex cpdIndex; ffsParser->parseCpdRegion(partition, partitions[i].ptEntry.Offset, partitionIndex, cpdIndex);