Skip to content

Commit

Permalink
MODSIGN: fix a compilation warning in extract-cert
Browse files Browse the repository at this point in the history
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: David Howells <[email protected]>
Reported-by: Jim Davis <[email protected]>
Acked-by : David Woodhouse <[email protected]>
Cc: James Morris <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
dhowells authored and torvalds committed Sep 11, 2015
1 parent 64d1def commit 7c0d35a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/extract-cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 7c0d35a

Please sign in to comment.