forked from Imagelibrary/binutils-gdb
Segfault in _bfd_delete_bfd with USE_MMAP
Any of the calls to _bfd_delete_bfd in bfd_fopen will hit this. * opncls.c (_bfd_delete_bfd): Check for non-NULL xvec before accessing flavour.
This commit is contained in:
@@ -164,7 +164,8 @@ static void
|
|||||||
_bfd_delete_bfd (bfd *abfd)
|
_bfd_delete_bfd (bfd *abfd)
|
||||||
{
|
{
|
||||||
#ifdef USE_MMAP
|
#ifdef USE_MMAP
|
||||||
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
|
if (abfd->xvec
|
||||||
|
&& abfd->xvec->flavour == bfd_target_elf_flavour)
|
||||||
{
|
{
|
||||||
asection *sec;
|
asection *sec;
|
||||||
for (sec = abfd->sections; sec != NULL; sec = sec->next)
|
for (sec = abfd->sections; sec != NULL; sec = sec->next)
|
||||||
|
|||||||
Reference in New Issue
Block a user