PR26418 UBSAN: cache.c:386 null pointer fwrite

The previous "fix" tested the wrong value.

	PR 26418
	* ecofflink.c (WRITE): Really don't write zero size chunks.
This commit is contained in:
Alan Modra
2020-08-28 21:45:49 +09:30
parent 1e597a8997
commit 7ca371dba5
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2020-08-28 Alan Modra <amodra@gmail.com>
PR 26418
* ecofflink.c (WRITE): Really don't write zero size chunks.
2020-08-28 Tuckker <tuckkern+sourceware@gmail.com>
PR 26543

View File

@ -1491,7 +1491,7 @@ bfd_ecoff_write_debug (bfd *abfd,
#define WRITE(ptr, count, size, offset) \
BFD_ASSERT (symhdr->offset == 0 \
|| (bfd_vma) bfd_tell (abfd) == symhdr->offset); \
if (size != 0 \
if (symhdr->count != 0 \
&& bfd_bwrite (debug->ptr, \
(bfd_size_type) size * symhdr->count, \
abfd) != size * symhdr->count) \