diff options
author | Nick Clifton <nickc@redhat.com> | 2017-08-10 09:37:36 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2017-08-10 09:37:36 +0100 |
commit | 957e1fc1c5d0262e4b2f764cf031ad1458446498 (patch) | |
tree | f506930d1d7c9475ac2920c8b4d54c1315f80189 /bfd/elf.c | |
parent | 3ecaa9fd728f6dd23de85efa0ceacf40da444c86 (diff) | |
download | binutils-957e1fc1c5d0262e4b2f764cf031ad1458446498.zip binutils-957e1fc1c5d0262e4b2f764cf031ad1458446498.tar.gz binutils-957e1fc1c5d0262e4b2f764cf031ad1458446498.tar.bz2 |
Fix out of bounds memory access when trying to allocate space for a note of size -1.
PR 21933
* elf.c (elf_read_notes): Check for a note size of -1.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -10997,7 +10997,7 @@ elf_read_notes (bfd *abfd, file_ptr offset, bfd_size_type size) { char *buf; - if (size <= 0) + if (size == 0 || (size + 1) == 0) return TRUE; if (bfd_seek (abfd, offset, SEEK_SET) != 0) |