+2014-11-17 Mark Wielaard <mjw@redhat.com>
+
+ * ppc64_init.c (ppc64_init): Check section name is not NULL.
+
2014-10-06 Mark Wielaard <mjw@redhat.com>
* libebl_CPU.h (dwarf_peel_type): Removed.
if (opd_shdr != NULL
&& (opd_shdr->sh_flags & SHF_ALLOC) != 0
&& opd_shdr->sh_type == SHT_PROGBITS
- && opd_shdr->sh_size > 0
- && strcmp (elf_strptr (elf, ehdr->e_shstrndx,
- opd_shdr->sh_name), ".opd") == 0)
+ && opd_shdr->sh_size > 0)
{
- eh->fd_addr = opd_shdr->sh_addr;
- eh->fd_data = elf_getdata (scn, NULL);
- break;
+ const char *name = elf_strptr (elf, ehdr->e_shstrndx,
+ opd_shdr->sh_name);
+ if (name != NULL && strcmp (name, ".opd") == 0)
+ {
+ eh->fd_addr = opd_shdr->sh_addr;
+ eh->fd_data = elf_getdata (scn, NULL);
+ break;
+ }
}
}
}
+2014-11-17 Mark Wielaard <mjw@redhat.com>
+
+ * ebldebugscnp.c (ebl_debugscn_p): Check name is not NULL.
+
2014-06-17 Mark Wielaard <mjw@redhat.com>
* eblinitreg.c (ebl_func_addr_mask): New function.
/* Check section name for being that of a debug informatino section.
- Copyright (C) 2002 Red Hat, Inc.
+ Copyright (C) 2002, 2014 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2002.
Ebl *ebl;
const char *name;
{
- return ebl->debugscn_p (name);
+ return name != NULL && ebl->debugscn_p (name);
}
+2014-11-17 Mark Wielaard <mjw@redhat.com>
+
+ * elf-knowledge.h (SECTION_STRIP_P): Check name is not NULL.
+
2014-11-16 Mark Wielaard <mjw@redhat.com>
* elf_getshdrstrndx.c: Check there are section headers before
/* Accumulation of various pieces of knowledge about ELF.
- Copyright (C) 2000-2012 Red Hat, Inc.
+ Copyright (C) 2000-2012, 2014 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2000.
&& (shdr)->sh_type != SHT_NOTE \
&& (((shdr)->sh_type) != SHT_PROGBITS \
/* Never remove .gnu.warning.* sections. */ \
- || (strncmp (name, ".gnu.warning.", sizeof ".gnu.warning." - 1) != 0 \
+ || (name != NULL \
+ && strncmp (name, ".gnu.warning.", sizeof ".gnu.warning." - 1) != 0\
/* We remove .comment sections only if explicitly told to do so. */\
&& (remove_comment \
|| strcmp (name, ".comment") != 0))))
+2014-11-17 Mark Wielaard <mjw@redhat.com>
+
+ * elfcmp.c (main): Check section names are NULL before use.
+ * objdump.c (section_match): Likewise.
+ * size.c (show_sysv): Likewise.
+
2014-11-17 Mark Wielaard <mjw@redhat.com>
* readelf.c (print_debug_frame_section): Warn if ptr_size is not 4
/* Compare relevant content of two ELF files.
- Copyright (C) 2005-2012 Red Hat, Inc.
+ Copyright (C) 2005-2012, 2014 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2005.
sym1->st_name);
const char *name2 = elf_strptr (elf2, shdr2->sh_link,
sym2->st_name);
- if (unlikely (strcmp (name1, name2) != 0
+ if (unlikely (name1 == NULL || name2 == NULL
+ || strcmp (name1, name2) != 0
|| sym1->st_value != sym2->st_value
|| (sym1->st_size != sym2->st_size
&& sym1->st_shndx != SHN_UNDEF)
/* Print information from ELF file in human-readable form.
- Copyright (C) 2005, 2006, 2007, 2009, 2011, 2012 Red Hat, Inc.
+ Copyright (C) 2005, 2006, 2007, 2009, 2011, 2012, 2014 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2005.
return true;
struct section_list *runp = section_list;
+ const char *name = elf_strptr (elf, shstrndx, shdr->sh_name);
do
{
if (runp->is_name)
{
- if (strcmp (runp->name,
- elf_strptr (elf, shstrndx, shdr->sh_name)) == 0)
+ if (name && strcmp (runp->name, name) == 0)
return true;
}
else
INTERNAL_ERROR (fullname);
/* Ignore all sections which are not used at runtime. */
- if ((shdr->sh_flags & SHF_ALLOC) != 0)
- maxlen = MAX (maxlen,
- (int) strlen (elf_strptr (elf, shstrndx,
- shdr->sh_name)));
+ const char *name = elf_strptr (elf, shstrndx, shdr->sh_name);
+ if (name != NULL && (shdr->sh_flags & SHF_ALLOC) != 0)
+ maxlen = MAX (maxlen, (int) strlen (name));
}
fputs_unlocked (fname, stdout);