GNU Binutils with patches for OS216
修订版 | c6f021093dbd26b4d8e761e9a19af817e9f2561f (tree) |
---|---|
时间 | 2019-02-12 01:15:59 |
作者 | Nick Clifton <nickc@redh...> |
Commiter | Nick Clifton |
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.
@@ -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 | + | |
1 | 7 | 2018-03-19 H.J. Lu <hongjiu.lu@intel.com> |
2 | 8 | |
3 | 9 | Backport from master branch |
@@ -976,6 +976,7 @@ print_symbol (bfd * abfd, | ||
976 | 976 | } |
977 | 977 | |
978 | 978 | symname = bfd_asymbol_name (sym); |
979 | + | |
979 | 980 | for (i = 0; i < seccount; i++) |
980 | 981 | { |
981 | 982 | long j; |
@@ -985,7 +986,9 @@ print_symbol (bfd * abfd, | ||
985 | 986 | arelent *r; |
986 | 987 | |
987 | 988 | r = relocs[i][j]; |
989 | + | |
988 | 990 | if (r->sym_ptr_ptr != NULL |
991 | + && * r->sym_ptr_ptr != NULL | |
989 | 992 | && (*r->sym_ptr_ptr)->section == sym->section |
990 | 993 | && (*r->sym_ptr_ptr)->value == sym->value |
991 | 994 | && strcmp (symname, |