summaryrefslogtreecommitdiff
path: root/plugins/ropgadgets/helper_arm.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-01-02 20:34:17 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-01-02 20:34:17 (GMT)
commit9bcc244de4b2f07e37025d5180fa37bbe6028fa1 (patch)
tree8a3327c64b48ba5eb4e17615bf59d1c81f352860 /plugins/ropgadgets/helper_arm.c
parent5db9effac12d781f179e329ea138fb531a5ae2a0 (diff)
Avoided playing with fire and local variable addresses.
Diffstat (limited to 'plugins/ropgadgets/helper_arm.c')
-rw-r--r--plugins/ropgadgets/helper_arm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/ropgadgets/helper_arm.c b/plugins/ropgadgets/helper_arm.c
index ae6edf3..e5ea1b0 100644
--- a/plugins/ropgadgets/helper_arm.c
+++ b/plugins/ropgadgets/helper_arm.c
@@ -28,6 +28,7 @@
#include <malloc.h>
+#include <common/cpp.h>
#include <plugins/arm/v7/context.h>
@@ -118,9 +119,11 @@ const phys_t *setup_instruction_sizes_for_arm(size_t *count)
{
const phys_t *result; /* Liste de taille à renvoyer */
- result = (phys_t []){ 2, 4 };
+ static const phys_t arm_sizes[] = { 2, 4 };
- *count = 2;
+ result = arm_sizes;
+
+ *count = ARRAY_SIZE(arm_sizes);;
return result;