This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] cgen: opcodes: Fix memory corruption in in lookup
- From: Stafford Horne <shorne at gmail dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 9 Feb 2017 06:58:48 +0900
- Subject: Re: [PATCH] cgen: opcodes: Fix memory corruption in in lookup
- Authentication-results: sourceware.org; auth=none
- References: <20170208164027.17843-1-shorne@gmail.com> <CAH=s-POQMYW2P1OJmFFo1CA6jbWQH7B5qOkjN5kNP09Zpym76A@mail.gmail.com>
Hi Yao,
On Wed, Feb 08, 2017 at 05:01:05PM +0000, Yao Qi wrote:
> Hi Stafford,
> opcodes/ changes should be reviewed in binutils@sourceware.org.
Right, it was late when I sent this and I was working on a gdb bug. So
just sent it here. Resent now to binutils list.
> On Wed, Feb 8, 2017 at 4:40 PM, Stafford Horne <shorne@gmail.com> wrote:
> > The buf variable is used after it is free'd. This causes the lookups to
> > fail and also causes memory corruption.
> >
> > Re-arrange the code a bit to make sure we always free memory before
> > returning. This was caught in openrisc testing, one of the only user of
> > this method.
> >
> > opcodes/ChangeLog:
> >
> > 2017-02-09 Stafford Horne <shorne@gmail.com>
> > cgen-opc.c (cgen_lookup_insn): Fix memory corruption issue.
>
> ChangeLog format issue,
>
> 017-02-09 Stafford Horne <shorne@gmail.com>
>
> * cgen-opc.c (cgen_lookup_insn): Fix memory corruption issue.
Thanks,
-Stafford