aboutsummaryrefslogtreecommitdiff
path: root/binutils/objcopy.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-05-18 15:21:16 +0100
committerNick Clifton <nickc@redhat.com>2016-05-18 15:21:16 +0100
commitf507bebf459de9b145bd8ccfcfa2f5f6690adac4 (patch)
tree770249a1ffeb0acbf73a61951c22e1e9d49e0583 /binutils/objcopy.c
parent9e8f9b05add4517189d7724ff3ed7c16f7b04daf (diff)
downloadgdb-f507bebf459de9b145bd8ccfcfa2f5f6690adac4.zip
gdb-f507bebf459de9b145bd8ccfcfa2f5f6690adac4.tar.gz
gdb-f507bebf459de9b145bd8ccfcfa2f5f6690adac4.tar.bz2
Prevent a run time segmentation fault when stripping a corrupt binary.
PR 20096 * objcopy.c (copy_relocations_in_section): Also check for the symbol pointed to by sym_ptr_ptr being NULL.
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r--binutils/objcopy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 198ba3a..0b21899 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -3250,7 +3250,9 @@ copy_relocations_in_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
for (i = 0; i < relcount; i++)
{
/* PR 17512: file: 9e907e0c. */
- if (relpp[i]->sym_ptr_ptr)
+ if (relpp[i]->sym_ptr_ptr
+ /* PR 20096 */
+ && * relpp[i]->sym_ptr_ptr)
if (is_specified_symbol (bfd_asymbol_name (*relpp[i]->sym_ptr_ptr),
keep_specific_htab))
temp_relpp [temp_relcount++] = relpp [i];