]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libebl: Check ebl is not NULL in ebl_symbol_[binding|type]_name.
authorMark Wielaard <mark@klomp.org>
Sun, 28 Apr 2019 11:40:45 +0000 (13:40 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 28 Apr 2019 11:40:45 +0000 (13:40 +0200)
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 <mark@klomp.org>
libebl/ChangeLog
libebl/eblsymbolbindingname.c
libebl/eblsymboltypename.c

index acc68919acc3bc172fb9e1d3d026682d4e5ffe45..e050bfc159923da136a43e58883ded0bc011f6af 100644 (file)
@@ -1,3 +1,10 @@
+2019-04-28  Mark Wielaard  <mark@klomp.org>
+
+       * 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  <mark@klomp.org>
 
        * eblobjnote.c (ebl_object_note): Check pr_datasz padding doesn't
index 97974253ae69e72d61db72661fcb358dedf54079..75565fe8128ff3c622cf0724d38eeab939807fda 100644 (file)
@@ -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";
index 09fa87480b9ea87392de7688751e0bc73c9d6df6..53b145a8312c6c8ea47e41927112ca025b89f2d4 100644 (file)
@@ -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";