From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: RFA/RFC: vCont for the remote protocol [client]
Date: Thu, 16 Oct 2003 22:14:00 -0000 [thread overview]
Message-ID: <20031016221433.GA553@nevyn.them.org> (raw)
In-Reply-To: <3F8F0B2B.9080506@redhat.com>
On Thu, Oct 16, 2003 at 05:18:35PM -0400, Andrew Cagney wrote:
>
> >Is GDB trying to move away from alloca? The internals manual says:
> >
> > GDB can use the non-portable function `alloca' for the allocation of
> > small temporary values (such as strings).
>
> >So I use it to avoid cleanups. OTOH, it occurs to me that
> >rs->remote_packet_size is a bit large; OTOOH, remote.c uses this idiom
> >all over the place already.
> >
> >I've used xmalloc instead, since the buf is used for getpkt and thus
> >must be remote_packet_size large.
> >
> >Here's what I am about to check in.
>
> There are two probems:
>
> - the buffer can get very very large and that can blow the stack
> - it isn't possible to audit this code (with out a deep understanding of
> that value) and hence demonstrate that the sprintf won't smash the
> stack/heap
>
> You'll need to also change the sprintf to snprintf (parameterized with
> remote_packet_size.
I don't see a point in doing that until someone expresses interest in
thread locking or some other feature which requires adding to the code.
The maximum length of any generated vcont packet is the length of:
vCont;C01:12341468;C02
The minimum possible buffer size is about twenty times that.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-10-16 22:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-29 15:28 Daniel Jacobowitz
2003-09-30 21:17 ` Daniel Jacobowitz
2003-10-15 0:15 ` Andrew Cagney
2003-10-16 20:31 ` Daniel Jacobowitz
2003-10-16 21:18 ` Andrew Cagney
2003-10-16 22:14 ` Daniel Jacobowitz [this message]
2003-10-16 22:27 ` Andrew Cagney
2003-10-16 22:53 ` Daniel Jacobowitz
2003-12-02 16:07 ` [RFA] Remove some sprintfs from vCont client support Daniel Jacobowitz
2003-12-03 4:25 ` Andrew Cagney
2004-01-18 3:39 ` Daniel Jacobowitz
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=20031016221433.GA553@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.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