From 2d0c2b83fbf7b08dde00bd541cac374f4a8e8e76 Mon Sep 17 00:00:00 2001 From: Ryan Snyder Date: Mon, 17 Sep 2018 15:29:23 -0400 Subject: api: fix read beyond bounds of basic block --- python/basicblock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python') diff --git a/python/basicblock.py b/python/basicblock.py index 353771d9..c98794cb 100644 --- a/python/basicblock.py +++ b/python/basicblock.py @@ -303,7 +303,7 @@ class BasicBlock(object): idx = start while idx < end: - data = self.view.read(idx, self.arch.max_instr_length) + data = self.view.read(idx, min(self.arch.max_instr_length, end - idx)) inst_info = self.arch.get_instruction_info(data, idx) inst_text = self.arch.get_instruction_text(data, idx) -- cgit v1.3.1