• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂b0029dce6867de1a2828293177b0e030d2f0f03c (tree)
時間2017-11-29 03:00:29
作者Nick Clifton <nickc@redh...>
CommiterNick Clifton

Log Message

Prevent a memory exhaustion problem when trying to read in strings from a COFF binary with a corrupt string table size.

PR 22507
* coffgen.c (_bfd_coff_read_string_table): Check for an excessive
size of the external string table.

Change Summary

差異

--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
11 2017-11-28 Nick Clifton <nickc@redhat.com>
22
3+ PR 22507
4+ * coffgen.c (_bfd_coff_read_string_table): Check for an excessive
5+ size of the external string table.
6+
7+2017-11-28 Nick Clifton <nickc@redhat.com>
8+
39 PR 22506
410 * reloc.c (reloc_offset_in_range): Rename to
511 bfd_reloc_offset_in_range and export.
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -1718,7 +1718,7 @@ _bfd_coff_read_string_table (bfd *abfd)
17181718 #endif
17191719 }
17201720
1721- if (strsize < STRING_SIZE_SIZE)
1721+ if (strsize < STRING_SIZE_SIZE || strsize > bfd_get_file_size (abfd))
17221722 {
17231723 _bfd_error_handler
17241724 /* xgettext: c-format */
@@ -1726,7 +1726,7 @@ _bfd_coff_read_string_table (bfd *abfd)
17261726 bfd_set_error (bfd_error_bad_value);
17271727 return NULL;
17281728 }
1729-
1729+
17301730 strings = (char *) bfd_malloc (strsize + 1);
17311731 if (strings == NULL)
17321732 return NULL;