From 0d96978c44a5070dd7beef05617900a149283cae Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Wed, 4 Oct 2017 09:03:47 +0700 Subject: [PATCH] Add out-of-bounds checking when resolving xrefs --- disassembler/disassembly.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/disassembler/disassembly.py b/disassembler/disassembly.py index b3889219..e95b1c86 100644 --- a/disassembler/disassembly.py +++ b/disassembler/disassembly.py @@ -104,8 +104,11 @@ class Disassembly: j = 0 - while(self.blocks[j].end_addr < dest): - j += 1 + try: + while(self.blocks[j].end_addr < dest): + j += 1 + except IndexError: + continue self.xrefs.append((block.id, self.blocks[j].id))