2009-08-03 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 3 Aug 2009 23:56:08 +0000 (23:56 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 3 Aug 2009 23:56:08 +0000 (23:56 +0000)
PR binutils/10363
* elf.c (bfd_elf_string_from_elf_section): Return NULL on
invalid string offset.

bfd/ChangeLog
bfd/elf.c

index 4107449f96a6f16e76ddf34085904372129a5f13..0dc369547efdc18f9b1cfe598943db5506b45d3b 100644 (file)
@@ -1,3 +1,9 @@
+2009-08-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/10363
+       * elf.c (bfd_elf_string_from_elf_section): Return NULL on
+       invalid string offset.
+
 2009-08-03  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/10433
index f27c607ab2b2a55387f7d305ef98bf46cb4cb8f1..9863a3a32db2a00edc5436c07f8aa5de9adcd0b1 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -331,7 +331,7 @@ bfd_elf_string_from_elf_section (bfd *abfd,
         (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;