public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [committed] Fix Wformat-security warning
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <20191217120705.GA25625@delia> (raw)

Hi,

When compiling using make CC=clang, we run into:
...
dwz.c:13819:16: warning: format string is not a string literal \
  (potentially insecure)
      [-Wformat-security]
  error (0, 0, msg);
               ^~~
dwz.c:13819:16: note: treat the string as an argument to avoid this
  error (0, 0, msg);
               ^
               "%s",
...

Fix the warning by making the format string a string literal, as suggested.

Committed to trunk.

Thanks,
- Tom

Fix Wformat-security warning

2019-12-17  Tom de Vries  <tdevries@suse.de>

	* dwz.c (usage): Fix Wformat-security warning.

---
 dwz.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dwz.c b/dwz.c
index 48833bc..524cd6f 100644
--- a/dwz.c
+++ b/dwz.c
@@ -13816,7 +13816,7 @@ usage (void)
        "  dwz [common options] [-h] [-m COMMONFILE] [-M NAME | -r] [FILES]\n"
        "  dwz [common options] -o OUTFILE FILE\n"
        "  dwz [ -v | -? ]");
-  error (0, 0, msg);
+  error (0, 0, "%s", msg);
 
   indent = 30;
   limit = 80;

                 reply	other threads:[~2019-12-17 12:07 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=20191217120705.GA25625@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).