From 9841343bcf0e93fd5d72e5f41c7e2b9939063568 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Fri, 18 Aug 2017 00:11:51 +0200 Subject: Skipped all empty binary portions as they are useless. --- ChangeLog | 5 +++++ src/format/executable.c | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fcd1f02..30d4c4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +17-08-18 Cyrille Bagard + + * src/format/executable.c: + Skip all empty binary portions as they are useless. + 17-08-17 Cyrille Bagard * src/analysis/disass/area.c: diff --git a/src/format/executable.c b/src/format/executable.c index ac67d62..6afe8b5 100644 --- a/src/format/executable.c +++ b/src/format/executable.c @@ -357,7 +357,16 @@ void g_exe_format_include_portion(GExeFormat *format, GBinPortion *portion, cons start = get_phy_addr(get_mrange_addr(range)); - if (start >= available) + if (get_mrange_length(range) == 0) + { + log_variadic_message(LMT_BAD_BINARY, _("The binary portion '%s' is empty and thus useless... Discarding!"), + g_binary_portion_get_desc(portion)); + + g_object_unref(G_OBJECT(portion)); + + } + + else if (start >= available) { assert(origin != NULL); -- cgit v0.11.2-87-g4458