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: [PATCH] xtensa: Properly strdup string when building reggroup


On Mon, Jun 12, 2017 at 10:38:09AM +0200, Simon Marchi wrote:
> On 2017-06-12 10:22, Yao Qi wrote:
> > This exposes another bug, IMO, here,
> > 
> >   for (i = 0; i < XTENSA_MAX_COPROCESSOR; i++)
> >     {
> >       cpname[2] = '0' + i;
> >       xtensa_cp[i] = reggroup_new (cpname, USER_REGGROUP);
> >     }
> > 
> > and XTENSA_MAX_COPROCESSOR is 0x10, so we can see "cp:", "cp;", which
> > looks odd.
> 
> Heh, looks like the patch here
> 
>   https://sourceware.org/ml/gdb-patches/2011-03/msg00571.html
> 
> did not take that into account :)

Right, I might was well resend the patch with an sprintf().

-Stafford


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