From 10bcb661c27a507df0a04d89c2c4dac6fb43236a Mon Sep 17 00:00:00 2001 From: caheckman <48068198+caheckman@users.noreply.github.com> Date: Fri, 4 Oct 2019 15:21:57 -0400 Subject: [PATCH] patch for stride overflow --- Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc index 76d68ea210..d1af1a4d67 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/jumptable.cc @@ -419,12 +419,13 @@ int4 JumpBasic::getStride(Varnode *vn) { uintb mask = vn->getNZMask(); + if ((mask & 0x3f)==0) // Limit the maximum stride we can return + return 32; int4 stride = 1; while((mask&1)==0) { mask >>= 1; stride <<= 1; } - if (stride > 32) return 1; return stride; }