Fix a seg-fault in the ELF note parser when a note with an excessively large alignment is encountered.

PR 22788
	* elf.c (elf_parse_notes): Reject notes with excessuively large
	alignments.
This commit is contained in:
Nick Clifton 2018-02-08 10:28:25 +00:00
parent a9479dc051
commit ef135d4314
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2018-02-08 Nick Clifton <nickc@redhat.com>
PR 22788
* elf.c (elf_parse_notes): Reject notes with excessuively large
alignments.
2018-02-07 Alan Modra <amodra@gmail.com>
Revert 2018-01-17 Alan Modra <amodra@gmail.com>

View File

@ -11012,6 +11012,8 @@ elf_parse_notes (bfd *abfd, char *buf, size_t size, file_ptr offset,
align is less than 4, we use 4 byte alignment. */
if (align < 4)
align = 4;
if (align != 4 && align != 8)
return FALSE;
p = buf;
while (p < buf + size)