public inbox for bfd@sourceware.org
 help / color / mirror / Atom feed
* PATCH for bfd in gas-990404
@ 1999-04-10  8:52 Manfred Hollstein
  0 siblings, 0 replies; only message in thread
From: Manfred Hollstein @ 1999-04-10  8:52 UTC (permalink / raw)
  To: ian, bfd

Hi there.

On Tue, 23 February 1999, 17:20:23, manfred@s-direktnet.de wrote:

 > This small patch fixes a bug I observed while running gdb-4.17
 > on a mips-sgi-irix5.3 system.  Since the debuggee's debug info
 > was larger than the system's virtual memory was able to provide,
 > the "goto error_return" in bfd/elf32-mips.c:_bfd_mips_elf_read_ecoff_info
 > got executed, which in turn tries to cleanup allocated memory.
 > Unfortunately, it's simply checking probably unitialized
 > memory to decide whether it should.
 > 

Nobody commented on this behaviour so far.  The bug is still there.

Later,
manfred

1999-04-10  Manfred Hollstein  <mhollstein@cygnus.com>

	* elf32-mips.c (_bfd_mips_elf_read_ecoff_info): Ensure only actually
	allocated members will be free'ed at error_return.

diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el gas-990404.orig/bfd/elf32-mips.c gas-990404/bfd/elf32-mips.c
--- gas-990404.orig/bfd/elf32-mips.c	Sun Apr  4 11:17:12 1999
+++ gas-990404/bfd/elf32-mips.c	Sat Apr 10 14:40:39 1999
@@ -3055,6 +3055,20 @@ _bfd_mips_elf_read_ecoff_info (abfd, sec
 
   swap = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;
 
+  /* Ensure only actually allocated members will be free'ed at
+     error_return.  */
+  debug->line = NULL;
+  debug->external_dnr = NULL;
+  debug->external_pdr = NULL;
+  debug->external_sym = NULL;
+  debug->external_opt = NULL;
+  debug->external_aux = NULL;
+  debug->ss = NULL;
+  debug->ssext = NULL;
+  debug->external_fdr = NULL;
+  debug->external_rfd = NULL;
+  debug->external_ext = NULL;
+
   ext_hdr = (char *) bfd_malloc ((size_t) swap->external_hdr_size);
   if (ext_hdr == NULL && swap->external_hdr_size != 0)
     goto error_return;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-04-10  8:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-10  8:52 PATCH for bfd in gas-990404 Manfred Hollstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).