all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Rob Browning <rlb@defaultvalue.org>
Cc: 10592@debbugs.gnu.org, 655118-forwarded@bugs.debian.org,
	jmm@inutil.org, 655118@bugs.debian.org
Subject: bug#10592: Bug#655118: Please enabled hardened build flags
Date: Tue, 24 Jan 2012 01:06:40 -0500	[thread overview]
Message-ID: <E1RpZWi-0006sb-8K@fencepost.gnu.org> (raw)
In-Reply-To: <87pqe98zc9.fsf@trouble.defaultvalue.org> (message from Rob Browning on Mon, 23 Jan 2012 23:05:26 -0600)

> From: Rob Browning <rlb@defaultvalue.org>
> Date: Mon, 23 Jan 2012 23:05:26 -0600
> Cc: 655118@bugs.debian.org, 655118-forwarded@bugs.debian.org,
> 	Moritz Mühlenhoff <jmm@inutil.org>
> 
> --- emacs23-23.3+1.orig/lib-src/movemail.c	2011-12-29 05:07:27.000000000 +0100
> +++ emacs23-23.3+1/lib-src/movemail.c	2012-01-08 17:31:22.000000000 +0100
> @@ -615,11 +615,11 @@
>  {
>    fprintf (stderr, "movemail: ");
>    if (s3)
> -    fprintf (stderr, s1, s2, s3);
> +    fprintf (stderr, "%s%s%s", s1, s2, s3);
>    else if (s2)
> -    fprintf (stderr, s1, s2);
> +    fprintf (stderr, "%s%s", s1, s2);
>    else
> -    fprintf (stderr, s1);
> +    fprintf (stderr, "%s", s1);
>    fprintf (stderr, "\n");
>  }

How can this possibly be TRT?  The commentary to this function says:

  /* Print error message.  `s1' is printf control string, `s2' and `s3'
     are args for it or null. */

If S1 is the printf control string, how will printing it with %s DTRT?
E.g., in this invocation:

      error ("Error connecting to POP server: %s", pop_error, 0);

or in this one:

      error ("Error in open: %s, %s", strerror (errno), outfile);

I think the right fix for this is to declare `error' with the
appropriate printf attribute.  Alternatively, you could use variable
argument lists and call vprintf instead.





  reply	other threads:[~2012-01-24  6:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120108171359.6340.17517.reportbug@pisco.westfalen.local>
     [not found] ` <20120108180151.GA919@pisco.westfalen.local>
2012-01-24  5:02   ` bug#10591: Bug#655118: Please enabled hardened build flags Rob Browning
2012-01-24  5:05     ` bug#10592: " Rob Browning
2012-01-24  6:06       ` Eli Zaretskii [this message]
2012-01-24 16:17         ` Rob Browning
2012-01-25  2:22         ` Rob Browning
2012-01-25  6:40           ` Eli Zaretskii
2012-01-26  3:13             ` Rob Browning
2012-01-26  3:25               ` Rob Browning
2012-01-31  4:22       ` Paul Eggert

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=E1RpZWi-0006sb-8K@fencepost.gnu.org \
    --to=eliz@gnu.org \
    --cc=10592@debbugs.gnu.org \
    --cc=655118-forwarded@bugs.debian.org \
    --cc=655118@bugs.debian.org \
    --cc=jmm@inutil.org \
    --cc=rlb@defaultvalue.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.