linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Davis <jim.epost@gmail.com>
To: linux-next <linux-next@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	dhowells@redhat.com, David Woodhouse <dwmw2@infradead.org>,
	keyrings@linux-nfs.org
Subject: Compiler warning with extract-cert.c in recent linux-next builds
Date: Thu, 3 Sep 2015 13:03:46 -0700	[thread overview]
Message-ID: <CA+r1ZhgY_oev6vMDCTp+54SwJZnyHQa4Ah6XBmBrYGGosjJDTA@mail.gmail.com> (raw)

Over the past couple of days, linux-next builds have been turning up
this compile warning

buildlog-1441309952.txt:scripts/extract-cert.c: In function ‘write_cert’:
buildlog-1441309952.txt:scripts/extract-cert.c:89:2: warning: format
not a string literal and no format arguments [-Wformat-security]
buildlog-1441309952.txt-  ERR(!i2d_X509_bio(wb, x509), cert_dst);
buildlog-1441309952.txt-  ^

This is on an Ubuntu 15.04 installation, with

jim@krebstar:~/linux-next-2$ gcc --version
gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2

Naively adding a "%s" format string silences the warning,

diff --git a/scripts/extract-cert.c b/scripts/extract-cert.c
index fd0db015c65c..907fbd888e7b 100644
--- a/scripts/extract-cert.c
+++ b/scripts/extract-cert.c
@@ -86,7 +86,7 @@ static void write_cert(X509 *x509)
         ERR(!wb, "%s", cert_dst);
     }
     X509_NAME_oneline(X509_get_subject_name(x509), buf, sizeof(buf));
-    ERR(!i2d_X509_bio(wb, x509), cert_dst);
+    ERR(!i2d_X509_bio(wb, x509), "%s",cert_dst);
     if (kbuild_verbose)
         fprintf(stderr, "Extracted cert: %s\n", buf);
 }

but I won't pretend to understand the code in detail!

-- 
Jim

                 reply	other threads:[~2015-09-03 20:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CA+r1ZhgY_oev6vMDCTp+54SwJZnyHQa4Ah6XBmBrYGGosjJDTA@mail.gmail.com \
    --to=jim.epost@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=keyrings@linux-nfs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.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.
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 NNTP newsgroup(s).