about summary refs log tree commit diff
path: root/frida_mode/src/cmplog/cmplog.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-11-18 10:24:25 +0100
committerGitHub <noreply@github.com>2021-11-18 10:24:25 +0100
commite131d0fc55ddc34e2a59c13b3bb24f4bc559301b (patch)
tree97b9b112d4529a96d2fe46d3a7f481dee2a2b175 /frida_mode/src/cmplog/cmplog.c
parent132630d48d0f9fe50e9388f941433c85636587da (diff)
parenta7b94338505d96a5d18b68916a4da6aa280e3f12 (diff)
downloadafl++-e131d0fc55ddc34e2a59c13b3bb24f4bc559301b.tar.gz
Merge pull request #1164 from WorksButNotTested/fix
Fix
Diffstat (limited to 'frida_mode/src/cmplog/cmplog.c')
-rw-r--r--frida_mode/src/cmplog/cmplog.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/frida_mode/src/cmplog/cmplog.c b/frida_mode/src/cmplog/cmplog.c
index 81e1a4b0..443baa1d 100644
--- a/frida_mode/src/cmplog/cmplog.c
+++ b/frida_mode/src/cmplog/cmplog.c
@@ -33,8 +33,22 @@ static gboolean cmplog_range(const GumRangeDetails *details,
 
 static gint cmplog_sort(gconstpointer a, gconstpointer b) {
 
-  return ((GumMemoryRange *)b)->base_address -
-         ((GumMemoryRange *)a)->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;
+
+  }
 
 }