diff options
author | Alan Modra <amodra@gmail.com> | 2022-12-16 18:13:38 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-12-17 18:44:42 +1030 |
commit | 6f00d50e2b6445f88b5f362dbbd982f387b6354f (patch) | |
tree | 32a7b6c0b61edd39f815820e4a4f5f4debe963e7 | |
parent | 499766a6d77994259b3cdff602d8f38d014d08ce (diff) | |
download | gdb-6f00d50e2b6445f88b5f362dbbd982f387b6354f.zip gdb-6f00d50e2b6445f88b5f362dbbd982f387b6354f.tar.gz gdb-6f00d50e2b6445f88b5f362dbbd982f387b6354f.tar.bz2 |
asan: elf.c:12621:18: applying zero offset to null pointer
That's this line in elf_parse_notes:
while (p < buf + size)
* elf.c (_bfd_elf_make_section_from_shdr): Don't call
elf_parse_notes when sh_size is zero.
-rw-r--r-- | bfd/elf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1110,7 +1110,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, /* We do not parse the PT_NOTE segments as we are interested even in the separate debug info files which may have the segments offsets corrupted. PT_NOTEs from the core files are currently not parsed using BFD. */ - if (hdr->sh_type == SHT_NOTE) + if (hdr->sh_type == SHT_NOTE && hdr->sh_size != 0) { bfd_byte *contents; |