core: don't process debug info if offset is incorrect (#259)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user