提交 7c0d35a3 编写于 作者: D David Howells 提交者: Linus Torvalds

MODSIGN: fix a compilation warning in extract-cert

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.
Signed-off-by: NDavid Howells <dhowells@redhat.com>
Reported-by: NJim Davis <jim.epost@gmail.com>
Acked-by : David Woodhouse <david.woodhouse@intel.com>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 64d1def7
...@@ -86,7 +86,7 @@ static void write_cert(X509 *x509) ...@@ -86,7 +86,7 @@ static void write_cert(X509 *x509)
ERR(!wb, "%s", cert_dst); ERR(!wb, "%s", cert_dst);
} }
X509_NAME_oneline(X509_get_subject_name(x509), buf, sizeof(buf)); 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) if (kbuild_verbose)
fprintf(stderr, "Extracted cert: %s\n", buf); fprintf(stderr, "Extracted cert: %s\n", buf);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册