Skip to content

Ghidra is a software reverse engineering (SRE) framework

patch for stride overflow

caheckman10bcb661c27a
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;
}