diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-02-02 23:51:27 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-02-02 23:51:27 (GMT) |
commit | 1a5aafe8e1c64289e438a277ac05d9e9a0f1bd49 (patch) | |
tree | 0a6d521fa3dfedd0d4d757ec01b81a7f6f265af0 /src | |
parent | a61984e52bfd35e19408b7cbdb11e3419f635829 (diff) |
Prevented access to uninitialised memory.
Diffstat (limited to 'src')
-rw-r--r-- | src/analysis/disass/area.c | 1 | ||||
-rw-r--r-- | src/glibext/gbinportion.c | 2 |
2 files changed, 3 insertions, 0 deletions
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); |