From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Siddhesh Poyarekar <siddhesh@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Replace potentially unsafe alloca with xmalloc/xfree in value_concat
Date: Fri, 14 Sep 2012 11:37:00 -0000 [thread overview]
Message-ID: <20120914113705.GA20303@host2.jankratochvil.net> (raw)
In-Reply-To: <20120914144629.67e493d0@spoyarek>
Hi Siddhesh,
On Fri, 14 Sep 2012 11:16:29 +0200, Siddhesh Poyarekar wrote:
> --- gdb/valarith.c 16 Aug 2012 07:36:20 -0000 1.105
> +++ gdb/valarith.c 14 Sep 2012 08:31:38 -0000
> @@ -668,9 +668,11 @@
> if (TYPE_CODE (type2) == TYPE_CODE_STRING
> || TYPE_CODE (type2) == TYPE_CODE_CHAR)
> {
> + struct cleanup *back_to;
Empty line after declarations.
> count = longest_to_int (value_as_long (inval1));
> inval2len = TYPE_LENGTH (type2);
> - ptr = (char *) alloca (count * inval2len);
> + ptr = (char *) xmalloc (count * inval2len);
> + back_to = make_cleanup (xfree, ptr);
OK with that change.
Thanks,
Jan
next prev parent reply other threads:[~2012-09-14 11:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-14 9:17 Siddhesh Poyarekar
2012-09-14 11:37 ` Jan Kratochvil [this message]
2012-09-14 12:49 ` Siddhesh Poyarekar
2012-09-14 12:55 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120914113705.GA20303@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=siddhesh@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox