aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-01-22 12:06:04 +0000
committerNick Clifton <nickc@redhat.com>2015-01-22 12:06:04 +0000
commit4e5cb37e7f3403d5398a323566ff9c995f0c9a81 (patch)
tree6c1f448ab158160c868ef83e3e3251a90b5b39ef /bfd/coffcode.h
parentb01a4b043a5b08e1208b1fedd61a6f3d65a328e0 (diff)
downloadgdb-4e5cb37e7f3403d5398a323566ff9c995f0c9a81.zip
gdb-4e5cb37e7f3403d5398a323566ff9c995f0c9a81.tar.gz
gdb-4e5cb37e7f3403d5398a323566ff9c995f0c9a81.tar.bz2
Fixes memory access violations triggered by running dlltool on fuzzed binaries.
PR binutils/17512 * coffcode.h (handle_COMDAT): When searching for the section symbol, make sure that there is space left in the symbol table. * vms-alpha.c (_bfd_vms_slurp_ehdr): Add range checks.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 181f9af..76e5873 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -1009,6 +1009,13 @@ handle_COMDAT (bfd * abfd,
seen_state = 1;
+ /* PR 17512: file: e2cfe54f. */
+ if (esym + bfd_coff_symesz (abfd) >= esymend)
+ {
+ _bfd_error_handler (_("%B: warning: No symbol for section '%s' found"),
+ abfd, symname);
+ break;
+ }
/* This is the section symbol. */
bfd_coff_swap_aux_in (abfd, (esym + bfd_coff_symesz (abfd)),
isym.n_type, isym.n_sclass,