summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/format/dex/dex-int.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/format/dex/dex-int.c b/src/format/dex/dex-int.c
index 79cdc57..b746f4d 100644
--- a/src/format/dex/dex-int.c
+++ b/src/format/dex/dex-int.c
@@ -24,6 +24,7 @@
#include "dex-int.h"
+#include <assert.h>
#include <malloc.h>
@@ -634,7 +635,7 @@ bool read_dex_encoded_catch_handler(const GDexFormat *format, vmpa2t *pos, encod
}
else handler->handlers = NULL;
- if (handler->size < 0)
+ if (handler->size <= 0)
result &= g_binary_content_read_uleb128(content, pos, &handler->catch_all_addr);
else
@@ -808,10 +809,15 @@ bool read_dex_code_item(const GDexFormat *format, vmpa2t *pos, code_item *item)
/* Padding ? */
if (item->tries_size > 0 && item->insns_size % 2 == 1)
+ {
result &= g_binary_content_read_u16(content, pos, SRE_LITTLE, &padding);
+ assert(padding == 0);
+ }
if (item->tries_size > 0 && result)
{
+ assert(get_phy_addr(pos) % 4 == 0);
+
item->tries = (try_item *)calloc(item->tries_size, sizeof(try_item));
for (i = 0; i < item->tries_size && result; i++)