This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Don't crash on invalid .def file
- From: Filip Navara <xnavara at volny dot cz>
- To: binutils at sources dot redhat dot com
- Date: Tue, 28 Sep 2004 02:11:23 +0200
- Subject: Re: [PATCH] Don't crash on invalid .def file
- References: <4158A3CD.4080007@volny.cz>
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)
{