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: CORE for which "readelf" and "objdump" fails - second attempt wi th CORE being "gzipped"


Hi Alexander,

  OK - I have had a look at your core file.  The patch below will
  prevent readelf from core dumping,  The choice of 255 as a maximum
  name length is arbitrary, but I think that it should be reasonable.

  In the future though, please take more care in posting to this
  list.  A 118K email message containing a core file is not something
  that most people will want to download.

Cheers
        Nick


Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.154
diff -c -3 -p -w -r1.154 readelf.c
*** binutils/readelf.c	21 Mar 2002 05:00:58 -0000	1.154
--- binutils/readelf.c	16 Apr 2002 14:39:12 -0000
*************** process_corefile_note_segment (file, off
*** 9450,9455 ****
--- 9437,9449 ----
        inote.descdata = inote.namedata + align_power (inote.namesz, 2);
        inote.descpos  = offset + (inote.descdata - (char *) pnotes);
  
+       if (inote.namesz > 255)
+ 	{
+ 	  warn (_("corrupt inote found at offset %x, namesz = %x\n"),
+ 		external, inote.namesz);
+ 	  break;
+ 	}
+ 
        external = (Elf_External_Note *)(inote.descdata + align_power (inote.descsz, 2));
  
        /* Verify that name is null terminated.  It appears that at least


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