unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Betoes <betoes@member.fsf.org>
Subject: Re: Let's tell we are using GTK+
Date: Wed, 20 Aug 2003 15:24:18 -0300	[thread overview]
Message-ID: <20030820182418.GA10777@milla.autsens.localnet> (raw)
In-Reply-To: <sgd65ku3rpu.fsf@occarina.pna.cwi.nl>

On Tue, Aug 19, 2003 at 11:46:21AM +0200, Lute Kamstra wrote:
> Terje Rosten <terjeros@phys.ntnu.no> writes:
> 
> > * Lute Kamstra
> > | 
> > | Maybe the GTK version should be mentioned as well.
> >
> > Updated patches with version information and the (annoying?) +
> > sign removed. emacs-version will now display something like this:
> >
> >  GNU Emacs 21.3.50.1 (i686-pc-linux-gnu, GTK+ 2.2.1) of 2003-08-04 on 
> >  myhost.net
> 
> I like it, but...
> 
> [...]
> 
> > +  {
> > +    char gtk_version[8];
> > +    sprintf (gtk_version, "%d.%d.%d", GTK_MAJOR_VERSION, GTK_MINOR_VERSION,
> > +	     GTK_MICRO_VERSION);
> > +    Vgtk_version_string = build_string (gtk_version);
> > +  }
> 
> this seems vulnerable to a buffer overflow.  It is acceptable to use
> snprintf instead, or isn't that portable enough?  (I'm not really
> intimate with C.)  What could be used instead, a larger string?

I believe, asprintf would be better, but I don't know about portability...

{
  char * gtk_version;
  asprintf (&gtk_version, "%d.%d.%d", GTK_MAJOR_VERSION, GTK_MINOR_VERSION,
          GTK_MICRO_VERSION);
  Vgtk_version_string = build_string (gtk_version);
  free(gtk_version);
}

  parent reply	other threads:[~2003-08-20 18:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-03 15:14 Let's tell we are using GTK+ Terje Rosten
2003-08-04  1:20 ` Miles Bader
2003-08-04  7:33   ` Terje Rosten
2003-08-04 17:31   ` Paul Jarc
2003-08-05  1:27     ` Miles Bader
2003-08-05  4:42     ` Stephen J. Turnbull
2003-08-05 19:15   ` Richard Stallman
2003-08-05 23:04     ` Kenichi Handa
2003-08-05 23:59       ` Masatake YAMATO
2003-08-06  7:56       ` Terje Rosten
2003-08-04  8:33 ` Lute Kamstra
2003-08-04 19:33   ` Terje Rosten
2003-08-19  9:46     ` Lute Kamstra
2003-08-19 10:46       ` Terje Rosten
2003-08-19 12:34         ` Lute Kamstra
2003-08-19 13:39       ` José Roberto B. de A. Monteiro
2003-08-19 14:31       ` Betoes
2003-08-20 18:24       ` Betoes [this message]
2003-08-21  9:59         ` Andreas Schwab
2003-08-24  0:10           ` Richard Stallman
2003-08-24 10:28             ` Lute Kamstra
2003-08-22 14:38         ` Richard Stallman
2003-08-23 20:07           ` Simon Josefsson

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030820182418.GA10777@milla.autsens.localnet \
    --to=betoes@member.fsf.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).