summaryrefslogtreecommitdiff
path: root/src/format/executable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/executable.c')
-rw-r--r--src/format/executable.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/format/executable.c b/src/format/executable.c
index fe3448d..f121f5b 100644
--- a/src/format/executable.c
+++ b/src/format/executable.c
@@ -30,6 +30,7 @@
#include "executable-int.h"
#include "format.h"
+#include "../gui/panels/log.h"
@@ -340,6 +341,17 @@ bool g_executable_format_complete_loading(GExeFormat *format, GtkStatusStack *st
void g_exe_format_include_portion(GExeFormat *format, GBinPortion *portion)
{
+ phys_t max; /* Position hors limite */
+ bool truncated; /* Modification faite ? */
+
+ max = g_binary_content_compute_size(G_BIN_FORMAT(format)->content);
+
+ truncated = g_binary_portion_limit_range(portion, max);
+
+ if (truncated)
+ log_variadic_message(LMT_BAD_BINARY, _("Truncated binary portion '%s' to fit the binary content size!"),
+ g_binary_portion_get_desc(portion));
+
g_mutex_lock(&format->mutex);
g_binary_portion_include(format->portions, portion);