From 10052884ec271c23cf2f984d6753dd6d8400be1f Mon Sep 17 00:00:00 2001 From: pancake Date: Fri, 17 Aug 2018 18:18:57 +0200 Subject: [PATCH] Fix crash in dex parser --- libr/bin/p/bin_dex.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libr/bin/p/bin_dex.c b/libr/bin/p/bin_dex.c index 61b268c11f..68e06d8bcc 100644 --- a/libr/bin/p/bin_dex.c +++ b/libr/bin/p/bin_dex.c @@ -421,7 +421,7 @@ static void dex_parse_debug_item(RBinFile *binfile, RBinDexObj *bin, return; } ut8 opcode = *(p4++) & 0xff; - while (keep) { + while (keep && p4 < p4_end) { switch (opcode) { case 0x0: // DBG_END_SEQUENCE keep = false; @@ -606,7 +606,6 @@ static void dex_parse_debug_item(RBinFile *binfile, RBinDexObj *bin, binfile->sdb_addrinfo = sdb_new0 (); } - RListIter *iter1; struct dex_debug_position_t *pos; // Loading the debug info takes too much time and nobody uses this afaik