PR23804, buffer overflow in sec_merge_hash_lookup

PR 23804
	* merge.c (_bfd_add_merge_section): Don't attempt to merge
	sections where size is not a multiple of entsize.
This commit is contained in:
Alan Modra 2018-10-23 18:29:24 +10:30
parent 8e3152af14
commit ab419ddbb2
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2018-10-23 Alan Modra <amodra@gmail.com>
PR 23804
* merge.c (_bfd_add_merge_section): Don't attempt to merge
sections where size is not a multiple of entsize.
2018-10-20 Alan Modra <amodra@gmail.com>
PR 23788

View File

@ -376,6 +376,9 @@ _bfd_add_merge_section (bfd *abfd, void **psinfo, asection *sec,
|| sec->entsize == 0)
return TRUE;
if (sec->size % sec->entsize != 0)
return TRUE;
if ((sec->flags & SEC_RELOC) != 0)
{
/* We aren't prepared to handle relocations in merged sections. */