This is the mail archive of the gdb-patches@sourceware.org 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: [commit/Tru64] bring back the Tru64 port to life...


Not knowing a thing about tru64 or osf,

On Thursday 05 March 2009 23:55:03, Joel Brobecker wrote:
> ? ?/* Allocate section space. ?*/
> - ?so->lm_info = xmalloc ((unsigned) &(((struct lm_info *)0)->secs) +
> -??????????????????????? nsecs * sizeof *so->lm_info);
> + ?so->lm_info = xmalloc (sizeof (struct lm_info)
> + ? ? ? ? ? ? ? ? ? ? ? ? + (nsecs - 1) * sizeof (struct lm_sec));

Can nsecs be 0 here?  Since it is checked at least here:

static void
osf_relocate_section_addresses (struct so_list *so,
				struct section_table *sec)
{
(...)
  if (lmi->nsecs && !lmi->secs[0].name)
    fetch_sec_names (lmi);

If, so, you'll allocate less memory than you want in that
case.

-- 
Pedro Alves


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