Skip to content
Permalink
Browse files

Gracefully deal with code addresses that are out of range in MutableM…

…ethodImplementation

The code addresses in debug info items are not verified, and may be out of
bounds. If this happens, we just clamp them to the maximum code address.
  • Loading branch information...
JesusFreke committed Mar 21, 2019
1 parent 580b27f commit 0d4443a19a591c506a4e9214f96003da210e2d86
Showing with 3 additions and 0 deletions.
  1. +3 −0 dexlib2/src/main/java/org/jf/dexlib2/builder/MutableMethodImplementation.java
@@ -473,6 +473,9 @@ private void fixInstructions() {
private int mapCodeAddressToIndex(@Nonnull int[] codeAddressToIndex, int codeAddress) {
int index;
do {
if (codeAddress >= codeAddressToIndex.length) {
codeAddress = codeAddressToIndex.length - 1;
}
index = codeAddressToIndex[codeAddress];
if (index < 0) {
codeAddress--;

0 comments on commit 0d4443a

Please sign in to comment.
You can’t perform that action at this time.