• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

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

修订版c6f021093dbd26b4d8e761e9a19af817e9f2561f (tree)
时间2019-02-12 01:15:59
作者Nick Clifton <nickc@redh...>
CommiterNick Clifton

Log Message

Fix a NULL pointer dereference in nm, when parsing a corrupt file.

PR 24168
* nm.c (print_symbol): Check for NULL contents of the sym_ptr_ptr
field.

更改概述

差异

--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
1+2019-02-11 Nick Clifton <nickc@redhat.com>
2+
3+ PR 24168
4+ * nm.c (print_symbol): Check for NULL contents of the sym_ptr_ptr
5+ field.
6+
17 2018-03-19 H.J. Lu <hongjiu.lu@intel.com>
28
39 Backport from master branch
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -976,6 +976,7 @@ print_symbol (bfd * abfd,
976976 }
977977
978978 symname = bfd_asymbol_name (sym);
979+
979980 for (i = 0; i < seccount; i++)
980981 {
981982 long j;
@@ -985,7 +986,9 @@ print_symbol (bfd * abfd,
985986 arelent *r;
986987
987988 r = relocs[i][j];
989+
988990 if (r->sym_ptr_ptr != NULL
991+ && * r->sym_ptr_ptr != NULL
989992 && (*r->sym_ptr_ptr)->section == sym->section
990993 && (*r->sym_ptr_ptr)->value == sym->value
991994 && strcmp (symname,