diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-08-27 18:15:41 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-08-27 18:15:41 (GMT) |
commit | 562a56f01cfb81ff7538418dd183aaa53e90b17c (patch) | |
tree | f330e35c6ec16eecc4c11db5e72ffd0930f102f8 /src/format | |
parent | dbb5a81c38ccbdefafc2abe3bd1e266a7fc42bc2 (diff) |
Took into account that loading types from the Dex pool may fail.
Diffstat (limited to 'src/format')
-rw-r--r-- | src/format/dex/class.c | 5 |
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)); |