aboutsummaryrefslogtreecommitdiff
path: root/bfd/peXXigen.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-10-28 15:42:56 +0000
committerNick Clifton <nickc@redhat.com>2014-10-28 15:42:56 +0000
commit5a4b0ccc20ba30caef53b01bee2c0aaa5b855339 (patch)
tree825a7b0ff2890362594ef66925c491755d59b65a /bfd/peXXigen.c
parent1df4399f27f8ee817d8eb4c73bba42bb65844303 (diff)
downloadfsf-binutils-gdb-5a4b0ccc20ba30caef53b01bee2c0aaa5b855339.zip
fsf-binutils-gdb-5a4b0ccc20ba30caef53b01bee2c0aaa5b855339.tar.gz
fsf-binutils-gdb-5a4b0ccc20ba30caef53b01bee2c0aaa5b855339.tar.bz2
More fixes for corrupt binaries crashing the binutils.
PR binutils/17512 * elf.c (bfd_section_from_shdr): Allocate and free the recursion detection table on a per-bfd basis. * peXXigen.c (pe_print_edata): Handle binaries with a truncated export table.
Diffstat (limited to 'bfd/peXXigen.c')
-rw-r--r--bfd/peXXigen.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 6129085..1a5cb31 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -1611,6 +1611,15 @@ pe_print_edata (bfd * abfd, void * vfile)
}
}
+ /* PR 17512: Handle corrupt PE binaries. */
+ if (datasize < 36)
+ {
+ fprintf (file,
+ _("\nThere is an export table in %s, but it is too small (%d)\n"),
+ section->name, (int) datasize);
+ return TRUE;
+ }
+
fprintf (file, _("\nThere is an export table in %s at 0x%lx\n"),
section->name, (unsigned long) addr);