This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix abort when running tools on a bogus binary.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=52c4f3bdd5957a31b671a9791f462be5e8eadd85

commit 52c4f3bdd5957a31b671a9791f462be5e8eadd85
Author: Nick Clifton <nickc@redhat.com>
Date:   Mon Dec 5 14:59:02 2016 +0000

    Fix abort when running tools on a bogus binary.
    
    	PR binutils/20907
    	* peicode.h (pe_ILF_build_a_bfd): Replace abort with error return.

Diff:
---
 bfd/ChangeLog | 3 +++
 bfd/peicode.h | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7388bb2..8dc48b3 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -5,6 +5,9 @@
 
 2016-12-05  Nick Clifton  <nickc@redhat.com>
 
+	PR binutils/20907
+	* peicode.h (pe_ILF_build_a_bfd): Replace abort with error return.
+
 	PR binutils/20921
 	* aoutx.h (squirt_out_relocs): Check for and report any relocs
 	that could not be recognised.
diff --git a/bfd/peicode.h b/bfd/peicode.h
index 9f98f86..ee47a67 100644
--- a/bfd/peicode.h
+++ b/bfd/peicode.h
@@ -892,8 +892,8 @@ pe_ILF_build_a_bfd (bfd *           abfd,
   if (import_name_type == IMPORT_ORDINAL)
     {
       if (ordinal == 0)
-	/* XXX - treat as IMPORT_NAME ??? */
-	abort ();
+	/* See PR 20907 for a reproducer.  */
+	goto error_return;
 
 #ifdef COFF_WITH_pex64
       ((unsigned int *) id4->contents)[0] = ordinal;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]