mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-25 02:53:48 +08:00
* elf.c (bfd_elf_string_from_elf_section): Return NULL on
invalid shstrndx. (bfd_elf_get_str_section): Likewise.
This commit is contained in:
parent
a1513dafcc
commit
74f2e02bf4
@ -1,3 +1,9 @@
|
||||
2007-05-14 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* elf.c (bfd_elf_string_from_elf_section): Return NULL on
|
||||
invalid shstrndx.
|
||||
(bfd_elf_get_str_section): Likewise.
|
||||
|
||||
2007-05-12 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
PR 4497
|
||||
|
@ -252,7 +252,9 @@ bfd_elf_get_str_section (bfd *abfd, unsigned int shindex)
|
||||
bfd_size_type shstrtabsize;
|
||||
|
||||
i_shdrp = elf_elfsections (abfd);
|
||||
if (i_shdrp == 0 || i_shdrp[shindex] == 0)
|
||||
if (i_shdrp == 0
|
||||
|| shindex >= elf_numsections (abfd)
|
||||
|| i_shdrp[shindex] == 0)
|
||||
return NULL;
|
||||
|
||||
shstrtab = i_shdrp[shindex]->contents;
|
||||
@ -291,6 +293,9 @@ bfd_elf_string_from_elf_section (bfd *abfd,
|
||||
if (strindex == 0)
|
||||
return "";
|
||||
|
||||
if (elf_elfsections (abfd) == NULL || shindex >= elf_numsections (abfd))
|
||||
return NULL;
|
||||
|
||||
hdr = elf_elfsections (abfd)[shindex];
|
||||
|
||||
if (hdr->contents == NULL
|
||||
|
Loading…
Reference in New Issue
Block a user