This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [commit/Tru64] bring back the Tru64 port to life...
- From: Pedro Alves <alves dot ped at gmail dot com>
- To: gdb-patches at sourceware dot org
- Cc: Joel Brobecker <brobecker at adacore dot com>
- Date: Fri, 6 Mar 2009 00:28:40 +0000
- Subject: Re: [commit/Tru64] bring back the Tru64 port to life...
- References: <20090305235503.GK3793@adacore.com>
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