diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/format/dex/class.c | 5 |
2 files changed, 8 insertions, 2 deletions
@@ -1,5 +1,10 @@ 17-08-27 Cyrille Bagard <nocbos@gmail.com> + * src/format/dex/class.c: + Take into account that loading types from the Dex pool may fail. + +17-08-27 Cyrille Bagard <nocbos@gmail.com> + * plugins/readdex/ids.c: Take into account that some instruction creations may fail. 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)); |