diff options
author | Alan Modra <amodra@gmail.com> | 2020-08-28 21:45:49 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-08-28 21:59:29 +0930 |
commit | 7ca371dba5d612ff1cdaa4ffe33474c1993fbe7f (patch) | |
tree | 5b2f3965c24591eed626395018170690c36a63c3 /bfd/ecofflink.c | |
parent | 1e597a89971e781f5c33d75009b2cbf26323d2a5 (diff) | |
download | gdb-7ca371dba5d612ff1cdaa4ffe33474c1993fbe7f.zip gdb-7ca371dba5d612ff1cdaa4ffe33474c1993fbe7f.tar.gz gdb-7ca371dba5d612ff1cdaa4ffe33474c1993fbe7f.tar.bz2 |
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.
Diffstat (limited to 'bfd/ecofflink.c')
-rw-r--r-- | bfd/ecofflink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/ecofflink.c b/bfd/ecofflink.c index 7c9a7ae..e8c3f9f 100644 --- a/bfd/ecofflink.c +++ b/bfd/ecofflink.c @@ -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) \ |