summaryrefslogtreecommitdiff
path: root/plugins/elf
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/elf')
-rw-r--r--plugins/elf/symbols.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/plugins/elf/symbols.c b/plugins/elf/symbols.c
index 949e495..90b9488 100644
--- a/plugins/elf/symbols.c
+++ b/plugins/elf/symbols.c
@@ -1185,7 +1185,7 @@ static bool do_elf_relocation_renaming(GElfLoading *loading, GElfFormat *format,
uint64_t index; /* Indice du symbole concerné */
char *name; /* Nouvelle désignation */
#ifndef NDEBUG
- const char *label; /* Etiquette courante */
+ char *label; /* Etiquette courante */
#endif
result = false;
@@ -1225,11 +1225,17 @@ static bool do_elf_relocation_renaming(GElfLoading *loading, GElfFormat *format,
label = g_binary_symbol_get_label(symbol);
- if (strncmp(label, "sub_", 4) != 0 && strncmp(label, "loc_", 4) != 0)
+ if (label != NULL)
{
- if (strncmp(name, label, strlen(label)) != 0)
- g_binary_format_add_error(G_BIN_FORMAT(format), BFE_SPECIFICATION, get_mrange_addr(range),
- _("Mismatch detected in the ELF symbol address"));
+ if (strncmp(label, "sub_", 4) != 0 && strncmp(label, "loc_", 4) != 0)
+ {
+ if (strncmp(name, label, strlen(label)) != 0)
+ g_binary_format_add_error(G_BIN_FORMAT(format), BFE_SPECIFICATION, get_mrange_addr(range),
+ _("Mismatch detected in the ELF symbol address"));
+ }
+
+ free(label);
+
}
#endif