diff options
author | van Hauser <vh@thc.org> | 2021-11-18 10:24:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-18 10:24:25 +0100 |
commit | e131d0fc55ddc34e2a59c13b3bb24f4bc559301b (patch) | |
tree | 97b9b112d4529a96d2fe46d3a7f481dee2a2b175 /frida_mode/src/ranges.c | |
parent | 132630d48d0f9fe50e9388f941433c85636587da (diff) | |
parent | a7b94338505d96a5d18b68916a4da6aa280e3f12 (diff) | |
download | afl++-e131d0fc55ddc34e2a59c13b3bb24f4bc559301b.tar.gz |
Merge pull request #1164 from WorksButNotTested/fix
Fix
Diffstat (limited to 'frida_mode/src/ranges.c')
-rw-r--r-- | frida_mode/src/ranges.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/frida_mode/src/ranges.c b/frida_mode/src/ranges.c index 027417ee..9844c74c 100644 --- a/frida_mode/src/ranges.c +++ b/frida_mode/src/ranges.c @@ -166,8 +166,22 @@ static void convert_token(gchar *token, GumMemoryRange *range) { gint range_sort(gconstpointer a, gconstpointer b) { - return ((GumMemoryRange *)a)->base_address - - ((GumMemoryRange *)b)->base_address; + GumMemoryRange *ra = (GumMemoryRange *)a; + GumMemoryRange *rb = (GumMemoryRange *)b; + + if (ra->base_address < rb->base_address) { + + return -1; + + } else if (ra->base_address > rb->base_address) { + + return 1; + + } else { + + return 0; + + } } @@ -249,7 +263,7 @@ static void check_for_overlaps(GArray *array) { GumAddress curr_limit = curr->base_address + curr->size; if (prev_limit > curr->base_address) { - FFATAL("OVerlapping ranges 0x%016" G_GINT64_MODIFIER + FFATAL("Overlapping ranges 0x%016" G_GINT64_MODIFIER "x-0x%016" G_GINT64_MODIFIER "x 0x%016" G_GINT64_MODIFIER "x-0x%016" G_GINT64_MODIFIER "x", prev->base_address, prev_limit, curr->base_address, curr_limit); |