summaryrefslogtreecommitdiff
path: root/plugins/readdex
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-08-27 18:14:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-08-27 18:14:19 (GMT)
commitdbb5a81c38ccbdefafc2abe3bd1e266a7fc42bc2 (patch)
treede1b90292e08154d26d4b58cb896d6d7be534b1f /plugins/readdex
parent47480a98d3c5c058755f3206765730dbfbf3ecef (diff)
Took into account that some instruction creations may fail.
Diffstat (limited to 'plugins/readdex')
-rw-r--r--plugins/readdex/ids.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/plugins/readdex/ids.c b/plugins/readdex/ids.c
index 518e9ad..88a60b0 100644
--- a/plugins/readdex/ids.c
+++ b/plugins/readdex/ids.c
@@ -24,7 +24,6 @@
#include "ids.h"
-#include <assert.h>
#include <malloc.h>
#include <stdio.h>
@@ -330,16 +329,20 @@ bool annotate_dex_string_ids(const GDexFormat *format, GPreloadInfo *info, GtkSt
{
instr = g_raw_instruction_new_array(content, MDS_8_BITS, length, &item_pos, endian);
- g_raw_instruction_mark_as_string(G_RAW_INSTRUCTION(instr), true);
+ if (instr != NULL)
+ {
+ g_raw_instruction_mark_as_string(G_RAW_INSTRUCTION(instr), true);
- inserted = g_preload_info_add_instruction(info, instr);
+ inserted = g_preload_info_add_instruction(info, instr);
- if (inserted)
- {
- range = g_arch_instruction_get_range(instr);
+ if (inserted)
+ {
+ range = g_arch_instruction_get_range(instr);
+
+ symbol = g_binary_symbol_new(range, STP_RO_STRING);
+ g_binary_format_add_symbol(bformat, symbol);
- symbol = g_binary_symbol_new(range, STP_RO_STRING);
- g_binary_format_add_symbol(bformat, symbol);
+ }
}