Commit e039a5a9 authored by Skylot's avatar Skylot

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

parent 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% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment