This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Further bfd robustification


Hi Jakub,

2005-06-14 Jakub Jelinek <jakub@redhat.com>

	* elf.c (bfd_section_from_shdr): Fail if sh_entsize is bogus for
	symbol, relocation, group or versym sections.

	* coffcode.h (coff_slurp_reloc_table): Don't crash if native_relocs
	is NULL.
	* peXXigen.c (pe_print_idata): Don't crash if dll_name or start_address
	doesn't point into the section.

Just one small issue:


     case SHT_GNU_versym:
+      if (hdr->sh_entsize != 2)
+	return FALSE;

@@ -2057,6 +2065,8 @@ bfd_section_from_shdr (bfd *abfd, unsign
       /* We need a BFD section for objcopy and relocatable linking,
 	 and it's handy to have the signature available as the section
 	 name.  */
+      if (hdr->sh_entsize != 4)
+	return FALSE;

I really think that these magic values ought to be defined macro constants declared in a header file somewhere (include/elf/common.h ?).


Cheers
  Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]