aboutsummaryrefslogtreecommitdiff
path: root/bfd/peXXigen.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-11-05 17:57:54 +0000
committerNick Clifton <nickc@redhat.com>2014-11-05 17:57:54 +0000
commita6f921c87700c2349cf6fa35fbc8ec9d3e3fb88e (patch)
tree909d407430c567e518224fff061fee9657081c83 /bfd/peXXigen.c
parent74e1a04b9787c02ba0fa9b93e3dae691bb44ed96 (diff)
downloadgdb-a6f921c87700c2349cf6fa35fbc8ec9d3e3fb88e.zip
gdb-a6f921c87700c2349cf6fa35fbc8ec9d3e3fb88e.tar.gz
gdb-a6f921c87700c2349cf6fa35fbc8ec9d3e3fb88e.tar.bz2
More fixes for memory problems uncovered by file fuzzers.
PR binutils/17512 * coffcode.h (handle_COMDAT): Replace abort with BFD_ASSERT. Replace another abort with an error message. (coff_slurp_line_table): Add more range checking. * peXXigen.c (pe_print_debugdata): Add range checking.
Diffstat (limited to 'bfd/peXXigen.c')
-rw-r--r--bfd/peXXigen.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index d031430..25f7273 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -2573,6 +2573,12 @@ pe_print_debugdata (bfd * abfd, void * vfile)
dataoff = addr - section->vma;
+ if (size > (section->size - dataoff))
+ {
+ fprintf (file, _("The debug data size field in the data directory is too big for the section"));
+ return FALSE;
+ }
+
fprintf (file,
_("Type Size Rva Offset\n"));