| Message ID | 20210609061532.12774-1-a@unstable.cc |
|---|---|
| State | Accepted |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id AHX0HaJcwGAsOQAAIUCqbw (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Wed, 09 Jun 2021 02:16:02 -0400 Received: from proxy10.mail.ord1d.rsapps.net ([172.30.191.6]) by director12.mail.ord1d.rsapps.net with LMTP id GNjOHaJcwGBIAwAAIasKDg (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Wed, 09 Jun 2021 02:16:02 -0400 Received: from smtp12.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy10.mail.ord1d.rsapps.net with LMTPS id 6IieHaJcwGD7BAAAfSg8FQ (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Wed, 09 Jun 2021 02:16:02 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp12.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: 298fb104-c8ea-11eb-a645-52540070b731-1-1 Received: from [216.105.38.7] ([216.105.38.7:52678] helo=lists.sourceforge.net) by smtp12.gate.ord1d.rsapps.net (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 46/11-19348-1AC50C06; Wed, 09 Jun 2021 02:16:01 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.92.3) (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) id 1lqrUH-0007Fs-LZ; Wed, 09 Jun 2021 06:14:49 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from <a@unstable.cc>) id 1lqrUF-0007Fg-2Z for openvpn-devel@lists.sourceforge.net; Wed, 09 Jun 2021 06:14:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3PTxyFtHlQdh0jcA2ef93O54//7TcgFeXITchlPPH48=; b=KNV0SCp2SesVXROF9yJuwBO98O Yf6G/BcteWyPv8VsWJG+PwVO2reHlj4pqL46aIBdVvAfZnoLK5V9gRCx4Wax6kE0iFSPageYFsZy3 mggupTtOf2SY+iiX3WCdIscKQEEB5I41H932KH/sU6CXybSlqRXAGtpssumZcj8Ahcm4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3PTxyFtHlQdh0jcA2ef93O54//7TcgFeXITchlPPH48=; b=h8Zc9d7k9iVC4sOkpspuN8BWvf Zyl8kQIkQX+vsLAJEYF6n0Uar9+rXBKBXULjvVh0dMKhAWEzCdQP5KxzIRsWHPSYAvp22uZ6hq9TE B8BStDUhVmPs2o0smeVBZUiQ99/etBlF+5Awh0qruckKIWKAKWa8nTAW6V3m+2YLqmRU=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lqrUC-0006Nw-4E for openvpn-devel@lists.sourceforge.net; Wed, 09 Jun 2021 06:14:47 +0000 From: Antonio Quartulli <a@unstable.cc> To: openvpn-devel@lists.sourceforge.net Date: Wed, 9 Jun 2021 08:15:32 +0200 Message-Id: <20210609061532.12774-1-a@unstable.cc> In-Reply-To: <20210608194330.1431202-1-arne@rfc2549.org> References: <20210608194330.1431202-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: unstable.cc] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1lqrUC-0006Nw-4E Subject: [Openvpn-devel] [PATCH v2] Silence warning about format string in check_ca_required X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: <openvpn-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel> List-Post: <mailto:openvpn-devel@lists.sourceforge.net> List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe> Cc: Antonio Quartulli <a@unstable.cc> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox |
| Series |
[Openvpn-devel,v2] Silence warning about format string in check_ca_required
|
|
Commit Message
Antonio Quartulli
June 8, 2021, 8:15 p.m. UTC
From: Arne Schwabe <arne@rfc2549.org> clang does not like if the format argument of printf like function is not a string literal (or constant): warning: format string is not a string literal (potentially insecure) Make the format string constant to silence the warning. Signed-off-by: Arne Schwabe <arne@rfc2549.org> Signed-off-by: Antonio Quartulli <a@unstable.cc> --- Changes from v1: * use const string instead of introducing "%s". @Arne I anticipated this change because I "assumed" you would be ok with it (patch is still yours), but feel free to comment of course. src/openvpn/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi On Wed, Jun 9, 2021 at 2:15 AM Antonio Quartulli <a@unstable.cc> wrote: > From: Arne Schwabe <arne@rfc2549.org> > > clang does not like if the format argument of printf like function > is not a string literal (or constant): > > warning: format string is not a string literal (potentially insecure) > > Make the format string constant to silence the warning. > > Signed-off-by: Arne Schwabe <arne@rfc2549.org> > Signed-off-by: Antonio Quartulli <a@unstable.cc> > --- > > Changes from v1: > * use const string instead of introducing "%s". > > @Arne I anticipated this change because I "assumed" you would be ok with > it (patch is still yours), but feel free to comment of course. > > > src/openvpn/options.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/openvpn/options.c b/src/openvpn/options.c > index 819979b1..086f7b6e 100644 > --- a/src/openvpn/options.c > +++ b/src/openvpn/options.c > @@ -2069,7 +2069,7 @@ check_ca_required(const struct options *options) > return; > } > > - const char* str = "You must define CA file (--ca)" > + const char* const str = "You must define CA file (--ca)" > #ifndef ENABLE_CRYPTO_MBEDTLS > " or CA path (--capath)" > #endif > -- > 2.31.1 > Changes from v1: > * use const string instead of introducing "%s". > @Arne I anticipated this change because I "assumed" you would be ok with > it (patch is still yours), but feel free to comment of course. > In that spirit, assuming Antonio would have acked this had it been submitted by Arne, I'm ready to ack this on his behalf.. Acked-by: <selva.nair@gmail.com> masquerading as "pick-your-name" Earnestly hoping these lines don't show up again in a patch for a very long time to come.. Selva <div dir="ltr"><div>Hi</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 9, 2021 at 2:15 AM Antonio Quartulli <a@unstable.cc> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Arne Schwabe <<a href="mailto:arne@rfc2549.org" target="_blank">arne@rfc2549.org</a>><br> <br> clang does not like if the format argument of printf like function<br> is not a string literal (or constant):<br> <br> warning: format string is not a string literal (potentially insecure)<br> <br> Make the format string constant to silence the warning.<br> <br> Signed-off-by: Arne Schwabe <<a href="mailto:arne@rfc2549.org" target="_blank">arne@rfc2549.org</a>><br> Signed-off-by: Antonio Quartulli <a@unstable.cc><br> ---<br> <br> Changes from v1:<br> * use const string instead of introducing "%s".<br> <br> @Arne I anticipated this change because I "assumed" you would be ok with<br> it (patch is still yours), but feel free to comment of course.<br> <br> <br> src/openvpn/options.c | 2 +-<br> 1 file changed, 1 insertion(+), 1 deletion(-)<br> <br> diff --git a/src/openvpn/options.c b/src/openvpn/options.c<br> index 819979b1..086f7b6e 100644<br> --- a/src/openvpn/options.c<br> +++ b/src/openvpn/options.c<br> @@ -2069,7 +2069,7 @@ check_ca_required(const struct options *options)<br> return;<br> }<br> <br> - const char* str = "You must define CA file (--ca)"<br> + const char* const str = "You must define CA file (--ca)"<br> #ifndef ENABLE_CRYPTO_MBEDTLS<br> " or CA path (--capath)"<br> #endif<br> -- <br> 2.31.1<br></blockquote><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Changes from v1:<br>* use const string instead of introducing "%s".<br>@Arne I anticipated this change because I "assumed" you would be ok with<br>it (patch is still yours), but feel free to comment of course.</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br></blockquote><div><br></div><div>In that spirit, assuming Antonio would have acked this had it been submitted by Arne, I'm ready to ack this on his behalf..</div><div><br></div><div>Acked-by: <<a href="mailto:selva.nair@gmail.com" target="_blank">selva.nair@gmail.com</a>> masquerading as "pick-your-name"</div><div><br></div><div>Earnestly hoping these lines don't show up again in a patch for a very long time to come..</div><div><br></div><div>Selva</div></div></div>
Your patch has been applied to the master branch.
And I side with Selva "I do not want to see more of these lines in a patch
for a very long time" :-)
commit d2e5412aa48e028c07bc7a3a9447593b711a9e0c
Author: Arne Schwabe
Date: Wed Jun 9 08:15:32 2021 +0200
Silence warning about format string in check_ca_required
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Selva Nair <selva.nair@gmail.com>
Message-Id: <20210609061532.12774-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22519.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 819979b1..086f7b6e 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -2069,7 +2069,7 @@ check_ca_required(const struct options *options) return; } - const char* str = "You must define CA file (--ca)" + const char* const str = "You must define CA file (--ca)" #ifndef ENABLE_CRYPTO_MBEDTLS " or CA path (--capath)" #endif