aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--disassembler_no_op.cc1
-rw-r--r--zucchini_apply.cc5
2 files changed, 6 insertions, 0 deletions
diff --git a/disassembler_no_op.cc b/disassembler_no_op.cc
index 3bc24d0..b17979c 100644
--- a/disassembler_no_op.cc
+++ b/disassembler_no_op.cc
@@ -24,6 +24,7 @@ std::vector<ReferenceGroup> DisassemblerNoOp::MakeReferenceGroups() const {
}
bool DisassemblerNoOp::Parse(ConstBufferView image) {
+ image_ = image;
return true;
}
diff --git a/zucchini_apply.cc b/zucchini_apply.cc
index 8969e3b..af4eab9 100644
--- a/zucchini_apply.cc
+++ b/zucchini_apply.cc
@@ -101,6 +101,11 @@ bool ApplyReferencesCorrection(ExecutableType exe_type,
LOG(ERROR) << "Failed to create Disassembler";
return false;
}
+ if (old_disasm->size() != old_image.size() ||
+ new_disasm->size() != new_image.size()) {
+ LOG(ERROR) << "Disassembler and element size mismatch";
+ return false;
+ }
ReferenceDeltaSource ref_delta_source = patch.GetReferenceDeltaSource();
std::map<PoolTag, std::vector<ReferenceGroup>> pool_groups;