From a180a6b30713f38f58a9adc89d775fd142f19629 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Thu, 28 Jun 2018 18:57:12 +0200 Subject: Limited ELF section name lengths as it is done for segment names. --- plugins/elf/format.c | 4 ++-- plugins/elf/strings.c | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/elf/format.c b/plugins/elf/format.c index 8c0f0fc..d41ba00 100644 --- a/plugins/elf/format.c +++ b/plugins/elf/format.c @@ -666,9 +666,9 @@ static void g_elf_format_refine_portions(GElfFormat *format) else name = NULL; if (name != NULL) - sprintf(desc, "%s \"%s\"", _("Section"), name); + snprintf(desc, MAX_PORTION_DESC, "%s \"%s\"", _("Section"), name); else - sprintf(desc, "%s ???", _("Section")); + snprintf(desc, MAX_PORTION_DESC, "%s ???", _("Section")); g_binary_portion_set_desc(new, desc); diff --git a/plugins/elf/strings.c b/plugins/elf/strings.c index cc40db1..a14b389 100644 --- a/plugins/elf/strings.c +++ b/plugins/elf/strings.c @@ -142,8 +142,6 @@ bool find_all_elf_strings(GElfFormat *format, wgroup_id_t gid, GtkStatusStack *s if (!got_string) { - assert(false); - max = ELF_HDR(format, format->header, e_phoff) + ELF_HDR(format, format->header, e_phnum) * ELF_SIZEOF_PHDR(format); -- cgit v0.11.2-87-g4458