Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: jan.kratochvil@redhat.com
Cc: gdbadmin@sourceware.org, gdb-patches@sourceware.org
Subject: Re: New ARI warning Sat May 28 01:53:47 UTC 2011
Date: Mon, 30 May 2011 19:16:00 -0000	[thread overview]
Message-ID: <201105301916.p4UJG4N2001438@glazunov.sibelius.xs4all.nl> (raw)
In-Reply-To: <20110530183455.GA26393@host1.jankratochvil.net> (message from	Jan Kratochvil on Mon, 30 May 2011 20:34:55 +0200)

> Date: Mon, 30 May 2011 20:34:55 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> 
> On Sat, 28 May 2011 03:53:47 +0200, GDB Administrator wrote:
> > 439a440
> > > gdb/linux-nat.c:2368: code: sprintf: Do not use sprintf, instead use xstrprintf
> > gdb/linux-nat.c:2368:  sprintf (buffer, ', lwp);
> 
> This is by me:
>   char buffer[MAXPATHLEN];
>   sprintf (buffer, "/proc/%ld/status", lwp);
> 
> I find the code perfectly correct, as I was told the ARI checks are only
> differential I hope it can be kept as is.

Sorry, no.  Please replace this with a call to xsnprintf.

While this particular call may be safe, people will have to check
again and again that it is whenever they audit the code in the future.
Replacing it with xsnprintf prevents that.


      parent reply	other threads:[~2011-05-30 19:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-28  1:54 GDB Administrator
2011-05-30 18:35 ` Jan Kratochvil
2011-05-30 18:59   ` Joel Brobecker
2011-05-30 19:29     ` [commit] " Jan Kratochvil
2011-05-30 19:38       ` Mark Kettenis
2011-05-30 19:50       ` Joel Brobecker
2011-05-30 19:59         ` [ARI/commit] enhance suggestion in "sprintf" rule (was: "Re: [commit] Re: New ARI warning Sat May 28 01:53:47 UTC 2011") Joel Brobecker
2011-05-31  7:58           ` Pierre Muller
2011-05-30 19:16   ` Mark Kettenis [this message]

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=201105301916.p4UJG4N2001438@glazunov.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=gdb-patches@sourceware.org \
    --cc=gdbadmin@sourceware.org \
    --cc=jan.kratochvil@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