aboutsummaryrefslogtreecommitdiff
path: root/binutils
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
parent9e8f9b05add4517189d7724ff3ed7c16f7b04daf (diff)
downloadbinutils-f507bebf459de9b145bd8ccfcfa2f5f6690adac4.zip
binutils-f507bebf459de9b145bd8ccfcfa2f5f6690adac4.tar.gz
binutils-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')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/objcopy.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index c4bb34e..64b409e 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2016-05-18 Nick Clifton <nickc@redhat.com>
+
+ PR 20096
+ * objcopy.c (copy_relocations_in_section): Also check for the
+ symbol pointed to by sym_ptr_ptr being NULL.
+
2016-05-18 Maciej W. Rozycki <macro@imgtec.com>
* testsuite/binutils-all/mips/mixed-mips16-micromips.d: New test.
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];