diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-01-26 23:40:07 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-01-26 23:40:07 (GMT) |
commit | 1b3887c5609831bc2aee2f00f6a4d31d7406a225 (patch) | |
tree | ad786c84551f664165540e5df87b5b386c5cc1aa | |
parent | 61c9454a718b1cf87029833d5fb493e09990dbfe (diff) |
Checked index for access to Dex class methods.
-rw-r--r-- | plugins/dex/class.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/dex/class.c b/plugins/dex/class.c index 9defac7..dafa984 100644 --- a/plugins/dex/class.c +++ b/plugins/dex/class.c @@ -636,9 +636,19 @@ GDexMethod *g_dex_class_get_method(const GDexClass *class, bool virtual, size_t GDexMethod *result; /* Instance à renvoyer */ if (virtual) - result = class->virtual_methods[index]; + { + if (index < class->vmethods_count) + result = class->virtual_methods[index]; + else + result = NULL; + } else - result = class->direct_methods[index]; + { + if (index < class->dmethods_count) + result = class->direct_methods[index]; + else + result = NULL; + } if (result != NULL) g_object_ref(G_OBJECT(result)); |