* Compiler warning with extract-cert.c in recent linux-next builds
@ 2015-09-03 20:03 Jim Davis
0 siblings, 0 replies; only message in thread
From: Jim Davis @ 2015-09-03 20:03 UTC (permalink / raw)
To: linux-next, linux-kernel, dhowells, David Woodhouse, keyrings
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-09-03 20:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-03 20:03 Compiler warning with extract-cert.c in recent linux-next builds Jim Davis
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).