提交 e2945f2a 编写于 作者: S Skylot

core: limit region traversal iterations count

上级 eaf623a5
......@@ -5,9 +5,12 @@ import jadx.core.dex.nodes.IContainer;
import jadx.core.dex.nodes.IRegion;
import jadx.core.dex.nodes.MethodNode;
import jadx.core.dex.trycatch.ExceptionHandler;
import jadx.core.utils.exceptions.JadxOverflowException;
public class DepthRegionTraversal {
private static final int ITERATIVE_LIMIT = 500;
private DepthRegionTraversal() {
}
......@@ -24,8 +27,12 @@ public class DepthRegionTraversal {
public static void traverseAllIterative(MethodNode mth, IRegionIterativeVisitor visitor) {
boolean repeat;
int k = 0;
do {
repeat = traverseAllIterativeInternal(mth, visitor);
if (k++ > ITERATIVE_LIMIT) {
throw new JadxOverflowException("Iterative traversal limit reached, method: " + mth);
}
} while (repeat);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册