提交 e039a5a9 编写于 作者: S Skylot

core: don't process debug info if offset is incorrect (#259)

上级 412a185f
......@@ -190,6 +190,10 @@ public class DexNode implements IDexNode {
return dexBuf.open(offset);
}
public boolean checkOffset(int dataOffset) {
return dataOffset >= 0 && dataOffset < dexBuf.getLength();
}
@Override
public RootNode root() {
return root;
......@@ -208,4 +212,5 @@ public class DexNode implements IDexNode {
public String toString() {
return "DEX";
}
}
......@@ -22,7 +22,7 @@ public class DebugInfoVisitor extends AbstractVisitor {
public void visit(MethodNode mth) throws JadxException {
try {
int debugOffset = mth.getDebugInfoOffset();
if (debugOffset > 0) {
if (debugOffset > 0 && mth.dex().checkOffset(debugOffset)) {
processDebugInfo(mth, debugOffset);
}
} catch (Exception e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册