mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: jmorris@namei.org
Cc: linux-security-module@vger.kernel.org, keyrings@vger.kernel.org,
	linux-kernel@vger.kernel.org, jim.epost@gmail.com
Subject: [PATCH] MODSIGN: Fix a compilation warning in extract-cert
Date: Tue, 08 Sep 2015 14:41:46 +0100	[thread overview]
Message-ID: <20150908134145.4131.71987.stgit@warthog.procyon.org.uk> (raw)

Fix the following warning when compiling extract-cert:

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

whereby the ERR() macro is taking cert_dst as the format string.  "%s"
should be used as the format string as the path could contain special
characters.

Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by : David Woodhouse <david.woodhouse@intel.com>
---

 scripts/extract-cert.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/extract-cert.c b/scripts/extract-cert.c
index fd0db015c65c..10d23ca9f617 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);
 }


             reply	other threads:[~2015-09-08 13:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-08 13:41 David Howells [this message]
2015-09-08 14:03 ` David Howells

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=20150908134145.4131.71987.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=jim.epost@gmail.com \
    --cc=jmorris@namei.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@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

all inboxes | Powered by JetHome®