summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2001-11-02 15:47:24 +0000
committerH.J. Lu <hjl@lucon.org>2001-11-02 15:47:24 +0000
commit139ddc84127487c943ab64b3e5517a67b452e796 (patch)
tree80119d5ac50ec8eeb972ed14f2d68c04e84dd867 /bfd
parent7e1a2e6d4c9307f956835e3bdab83df8638d13bd (diff)
downloadgdb-139ddc84127487c943ab64b3e5517a67b452e796.tar.gz
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')
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/coffgen.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f18998c0903..f521ff7cfa6 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2001-11-02 H.J. Lu (hjl@gnu.org)
+
+ * coffgen.c (coff_object_p): Return 0 if the header is too big.
+
2001-11-02 Hans-Peter Nilsson <hp@axis.com>
* elfcore.h (elf_core_file_p): Preserve and clear abfd section
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index 4957c141f6b..2ae435b2dcd 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;