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] Fixes a couple of bugs reported in dlltool.


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

commit 030f4c7f08246bdc79d74c4c297729003773b67c
Author: Stephen Kitt <steve@sk2.org>
Date:   Fri May 29 11:03:03 2015 +0100

    Fixes a couple of bugs reported in dlltool.
    
    	* dlltool.c (make_one_lib_file): Clear .idata$6 before use.
    	(main): Fail if the output file specified by the -z option cannot
    	be opened.

Diff:
---
 binutils/ChangeLog | 6 ++++++
 binutils/dlltool.c | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 6bb1f1a..f681468 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2015-05-29  Stephen Kitt  <steve@sk2.org>
+
+	* dlltool.c (make_one_lib_file): Clear .idata$6 before use.
+	(main): Fail if the output file specified by the -z option cannot
+	be opened.
+
 2015-05-18  Nick Clifton  <nickc@redhat.com>
 
 	PR binutils/18420
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index e83052a..6aa11dd 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -2783,6 +2783,7 @@ make_one_lib_file (export_type *exp, int i, int delay)
 	      else
 	        si->size = strlen (xlate (exp->import_name)) + 3;
 	      si->data = xmalloc (si->size);
+	      memset (si->data, 0, si->size);
 	      si->data[0] = idx & 0xff;
 	      si->data[1] = idx >> 8;
 	      if (exp->its_name)
@@ -4151,6 +4152,9 @@ main (int ac, char **av)
 	  break;
 	case 'z':
 	  output_def = fopen (optarg, FOPEN_WT);
+	  if (!output_def)
+	    /* xgettext:c-format */
+	    fatal (_("Unable to open def-file: %s"), optarg);
 	  break;
 	case 'D':
 	  dll_name = (char*) lbasename (optarg);


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