From ef02658049fc844cfbd60c5ae16d2e523e5249c9 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 12 Feb 2018 19:52:51 +0000 Subject: [PATCH] fuzz_with_unicorn: Fix read-past-end access via jit_iter --- tests/A64/fuzz_with_unicorn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/A64/fuzz_with_unicorn.cpp b/tests/A64/fuzz_with_unicorn.cpp index e21ca327..d9142012 100644 --- a/tests/A64/fuzz_with_unicorn.cpp +++ b/tests/A64/fuzz_with_unicorn.cpp @@ -150,7 +150,7 @@ static void RunTestInstance(const std::array& regs, const std::arrayfirst > jit_iter->first) { + if (uni_iter == uni_env.modified_memory.end() || (jit_iter != jit_env.modified_memory.end() && uni_iter->first > jit_iter->first)) { fmt::print("{:016x}: {:02x} *\n", jit_iter->first, jit_iter->second); jit_iter++; } else if (jit_iter == jit_env.modified_memory.end() || jit_iter->first > uni_iter->first) {