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

This commit is contained in:
Skylot
2018-05-01 19:32:55 +03:00
parent 412a185fa1
commit e039a5a9af
2 changed files with 6 additions and 1 deletions
@@ -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) {