This is the mail archive of the binutils@sourceware.org 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]

PATCH: PR ld/10363: objdump -T crashes on corrupted file


Hi,

We shouldn't return a valid string on an invalid string offset. OK to
install?

Thanks.


H.J.
----
2009-08-30  H.J. Lu  <hongjiu.lu@intel.com>

	 PR ld/10363
	 * elf.c (bfd_elf_string_from_elf_section): Return NULL on
	 invalid string offset.

Index: bfd/elf.c
===================================================================
--- bfd/elf.c	(revision 6507)
+++ bfd/elf.c	(working copy)
@@ -331,7 +331,7 @@ bfd_elf_string_from_elf_section (bfd *ab
 	 (shindex == shstrndx && strindex == hdr->sh_name
 	  ? ".shstrtab"
 	  : bfd_elf_string_from_elf_section (abfd, shstrndx, hdr->sh_name)));
-      return "";
+      return NULL;
     }
 
   return ((char *) hdr->contents) + strindex;


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