From: Mark Wielaard Date: Sun, 28 Apr 2019 11:40:45 +0000 (+0200) Subject: libebl: Check ebl is not NULL in ebl_symbol_[binding|type]_name. X-Git-Tag: elfutils-0.177~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7190c2043152477b720e204166d0690da9c7b913;p=thirdparty%2Felfutils.git libebl: Check ebl is not NULL in ebl_symbol_[binding|type]_name. For STB_GNU_UNIQUE and STT_GNU_IFUNC we need to check the elf of the given ebl. Make sure the ebl given isn't NULL. Signed-off-by: Mark Wielaard --- diff --git a/libebl/ChangeLog b/libebl/ChangeLog index acc68919a..e050bfc15 100644 --- a/libebl/ChangeLog +++ b/libebl/ChangeLog @@ -1,3 +1,10 @@ +2019-04-28 Mark Wielaard + + * eblsymbolbindingname.c (ebl_symbol_binding_name): Check ebl is + not NULL for STB_GNU_UNIQUE. + * eblsymboltypename.c (ebl_symbol_type_name): Check ebl is not + NULL for STT_GNU_IFUNC. + 2019-01-29 Mark Wielaard * eblobjnote.c (ebl_object_note): Check pr_datasz padding doesn't diff --git a/libebl/eblsymbolbindingname.c b/libebl/eblsymbolbindingname.c index 97974253a..75565fe81 100644 --- a/libebl/eblsymbolbindingname.c +++ b/libebl/eblsymbolbindingname.c @@ -58,6 +58,7 @@ ebl_symbol_binding_name (Ebl *ebl, int binding, char *buf, size_t len) if (binding >= STB_LOPROC && binding <= STB_HIPROC) snprintf (buf, len, "LOPROC+%d", binding - STB_LOPROC); else if (binding == STB_GNU_UNIQUE + && ebl != NULL && (ident = elf_getident (ebl->elf, NULL)) != NULL && ident[EI_OSABI] == ELFOSABI_LINUX) return "GNU_UNIQUE"; diff --git a/libebl/eblsymboltypename.c b/libebl/eblsymboltypename.c index 09fa87480..53b145a83 100644 --- a/libebl/eblsymboltypename.c +++ b/libebl/eblsymboltypename.c @@ -64,6 +64,7 @@ ebl_symbol_type_name (Ebl *ebl, int symbol, char *buf, size_t len) if (symbol >= STT_LOPROC && symbol <= STT_HIPROC) snprintf (buf, len, "LOPROC+%d", symbol - STT_LOPROC); else if (symbol == STT_GNU_IFUNC + && ebl != NULL && (ident = elf_getident (ebl->elf, NULL)) != NULL && ident[EI_OSABI] == ELFOSABI_LINUX) return "GNU_IFUNC";