This is the mail archive of the binutils@sources.redhat.com 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]

Re: [PATCH] Don't crash on invalid .def file


Filip Navara wrote:
Abstract:

When an unparsable .def file is passed on command line to "ld" an crash happens. This is because def_file_parse deletes the def_file context that was passed to it and gld_i386pe_unrecognized_file still treats it as a valid pointer and operates with it...


Sorry, use the attached patch instead...
Changelog:

2004-09-27  Filip Navara  <navaraf@reactos.com>

	* emultempl/pe.em (gld_${EMULATION_NAME}_unrecognized_file):
	Prevent crash with invalid .def files.

--- ld/emultempl/pe.em	Sat Sep 18 13:45:56 2004
+++ ld/emultempl/pe.em	Tue Sep 28 01:23:08 2004
@@ -1291,10 +1291,7 @@
 
   if (strcmp (ext, ".def") == 0 || strcmp (ext, ".DEF") == 0)
     {
-      if (pe_def_file == 0)
-	pe_def_file = def_file_empty ();
-
-      def_file_parse (entry->filename, pe_def_file);
+      pe_def_file = def_file_parse (entry->filename, pe_def_file);
 
       if (pe_def_file)
 	{

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