aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffgen.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2001-11-02 15:47:24 +0000
committerH.J. Lu <hjl.tools@gmail.com>2001-11-02 15:47:24 +0000
commit95f7d9f7b7f3def3c1f96cfc6077668d3d8bb5b4 (patch)
tree629651c7a1ca4e252a9dfc03d8182c7866198fa0 /bfd/coffgen.c
parent3559696cf5bdd09e90b0ff554da90d081f52d570 (diff)
downloadgdb-95f7d9f7b7f3def3c1f96cfc6077668d3d8bb5b4.zip
gdb-95f7d9f7b7f3def3c1f96cfc6077668d3d8bb5b4.tar.gz
gdb-95f7d9f7b7f3def3c1f96cfc6077668d3d8bb5b4.tar.bz2
2001-11-02 H.J. Lu (hjl@gnu.org)
* coffgen.c (coff_object_p): Return 0 if the header is too big.
Diffstat (limited to 'bfd/coffgen.c')
-rw-r--r--bfd/coffgen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index 4957c14..2ae435b 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -280,7 +280,8 @@ coff_object_p (abfd)
bfd_coff_swap_filehdr_in (abfd, filehdr, &internal_f);
bfd_release (abfd, filehdr);
- if (bfd_coff_bad_format_hook (abfd, &internal_f) == false)
+ if (bfd_coff_bad_format_hook (abfd, &internal_f) == false
+ || internal_f.f_opthdr > aoutsz)
{
bfd_set_error (bfd_error_wrong_format);
return 0;