From c6aa130f78f1314bd01dba564a7ba6ec531d5601 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Fri, 27 Jul 2007 18:50:18 +0000 Subject: [PATCH] 2007-07-27 Michael Snyder * elf32-i386.c (elf_i386_check_relocs): Check for null pointer. --- bfd/ChangeLog | 6 +++++- bfd/elf32-i386.c | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d8d658682b..ef6e817cc2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2007-07-27 Michael Snyder + + * elf32-i386.c (elf_i386_check_relocs): Check for null pointer. + 2007-07-27 H.J. Lu * config.bfd (x86_64-*-mingw*): Don't include x86_64coff_vec. @@ -473,7 +477,7 @@ (elf32_arm_final_link_relocate): Turn call to undefined symbol into a jump to the next instruction. -2007-06-29 Michael Snyder +2007-06-29 Michael Snyder * bfd.c (bfd_demangle): Plug memory leak (Coverity). diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index abac6b2d10..c50e98d92b 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1270,14 +1270,18 @@ elf_i386_check_relocs (bfd *abfd, /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ case R_386_GNU_VTINHERIT: - if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + BFD_ASSERT (h != NULL); + if (h != NULL + && !bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) return FALSE; break; /* This relocation describes which C++ vtable entries are actually used. Record for later use during GC. */ case R_386_GNU_VTENTRY: - if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset)) + BFD_ASSERT (h != NULL); + if (h != NULL + && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset)) return FALSE; break; -- 2.34.1