summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--src/analysis/disass/area.c1
-rw-r--r--src/glibext/gbinportion.c2
3 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5fc748f..ab91ed8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+16-02-03 Cyrille Bagard <nocbos@gmail.com>
+
+ * src/analysis/disass/area.c:
+ * src/glibext/gbinportion.c:
+ Prevent access to uninitialised memory.
+
16-02-02 Cyrille Bagard <nocbos@gmail.com>
* src/analysis/project.c:
diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c
index c2fee99..5f63c82 100644
--- a/src/analysis/disass/area.c
+++ b/src/analysis/disass/area.c
@@ -2212,6 +2212,7 @@ mem_area *compute_memory_areas(GExeFormat *format, phys_t bin_length, size_t *co
printf("--------------------\n");
portions = NULL;//g_exe_format_get_portions_at_level(format, -1, &portions_count);
+ portions_count = 0;
for (i = 1; i < portions_count; i++)
diff --git a/src/glibext/gbinportion.c b/src/glibext/gbinportion.c
index 0744a79..454fc6b 100644
--- a/src/glibext/gbinportion.c
+++ b/src/glibext/gbinportion.c
@@ -1003,6 +1003,8 @@ GBinPortion **g_portion_layer_collect_all_portions(const GPortionLayer *layer, s
}
+ *count = 0;
+
result = do_collect(layer, NULL, count);
qsort(result, *count, sizeof(GBinPortion *), (__compar_fn_t)g_binary_portion_compare);