This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB 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: gdb/1479: elf_symtab_read sectinfo array size max_index


The following reply was made to PR gdb/1479; it has been noted by GNATS.

From: Daniel Jacobowitz <drow@mvista.com>
To: tommoo@telco4u.net
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/1479: elf_symtab_read sectinfo array size max_index
Date: Tue, 9 Dec 2003 10:51:45 -0500

 On Tue, Dec 09, 2003 at 03:45:49PM -0000, tommoo@telco4u.net wrote:
 > 
 > >Number:         1479
 > >Category:       gdb
 > >Synopsis:       elf_symtab_read sectinfo array size max_index
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    unassigned
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Tue Dec 09 15:48:01 UTC 2003
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Tom Lucas
 > >Release:        gdb-6.0
 > >Organization:
 > >Environment:
 > Solaris 2.6 sun4u sparc SUNW,Ultra-5_10
 > >Description:
 > File: gdb/elfread.c
 > Function: elf_symtab_read
 > Context: Lines 397-406?
 > 			      max_index 
 > 				= max (SECT_OFF_BSS (objfile),
 > 				       max (SECT_OFF_DATA (objfile),
 > 					    SECT_OFF_RODATA (objfile)));
 > 			      size = (sizeof (struct stab_section_info) 
 > 				      + (sizeof (CORE_ADDR)
 > 					 * (max_index-1) ));
 > 			      sectinfo = (struct stab_section_info *)
 > 				xmmalloc (objfile->md, size);
 > 
 > Problem:
 > The size of the sections array is 1 too small because
 > (max_index-1) (+ 1 for the entry included in the
 > stab_section_info struct) gives max_index entries.
 > Therefore max_index is one more than the last index.
 > 
 > This was causing gdb to SEGV for me until I changed it.
 
 Yes, this is already fixd in CVS, I believe.  Could you try a CVS
 snapshot (http://sources.redhat.com/gdb/) and check?
 
 -- 
 Daniel Jacobowitz
 MontaVista Software                         Debian GNU/Linux Developer


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