summaryrefslogtreecommitdiff
path: root/src/format/dex
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-08-27 18:15:41 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-08-27 18:15:41 (GMT)
commit562a56f01cfb81ff7538418dd183aaa53e90b17c (patch)
treef330e35c6ec16eecc4c11db5e72ffd0930f102f8 /src/format/dex
parentdbb5a81c38ccbdefafc2abe3bd1e266a7fc42bc2 (diff)
Took into account that loading types from the Dex pool may fail.
Diffstat (limited to 'src/format/dex')
-rw-r--r--src/format/dex/class.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/format/dex/class.c b/src/format/dex/class.c
index eb2ba3f..bb2ae71 100644
--- a/src/format/dex/class.c
+++ b/src/format/dex/class.c
@@ -24,7 +24,6 @@
#include "class.h"
-#include <assert.h>
#include <malloc.h>
@@ -233,7 +232,7 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def)
if (def->access_flags & ACC_ANNOTATION) goto gdcn_done;
ctype = get_type_from_dex_pool(format, def->class_idx);
- assert(ctype != NULL);
+ if (ctype == NULL) goto gdcn_unknown_type;
base = G_BIN_FORMAT(format);
@@ -299,6 +298,8 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def)
g_object_unref(G_OBJECT(ctype));
+ gdcn_unknown_type:
+
gdcn_bad_item:
g_object_unref(G_OBJECT(result));