From: Phil Sutter <phil@nwl.cc>
To: Florian Westphal <fw@strlen.de>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>, netfilter-devel@vger.kernel.org
Subject: Re: [nft PATCH 2/2] nfnl_osf: Silence string truncation gcc warnings
Date: Sat, 20 Jul 2019 22:22:40 +0200 [thread overview]
Message-ID: <20190720202240.GH32501@orbyte.nwl.cc> (raw)
In-Reply-To: <20190720193628.fysp5cdofer2vi32@breakpoint.cc>
On Sat, Jul 20, 2019 at 09:36:28PM +0200, Florian Westphal wrote:
> Phil Sutter <phil@nwl.cc> wrote:
> > Albeit a bit too enthusiastic, gcc is right in that these strings may be
> > truncated since the destination buffer is smaller than the source one.
> > Get rid of the warnings (and the potential problem) by specifying a
> > string "precision" of one character less than the destination. This
> > ensures a terminating nul-character may be written as well.
>
> Fernando sent a patch for this already, with the notable difference
> of altering the size of the destination buffer by one.
Ah, thanks! I missed it. Replied to it pointing at my patch, also
spotted a typo in his patch. :)
Cheers, Phil
next prev parent reply other threads:[~2019-07-20 20:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-20 18:52 [nft PATCH 1/2] parser_bison: Get rid of (most) bison compiler warnings Phil Sutter
2019-07-20 18:52 ` [nft PATCH 2/2] nfnl_osf: Silence string truncation gcc warnings Phil Sutter
2019-07-20 19:36 ` Florian Westphal
2019-07-20 20:22 ` Phil Sutter [this message]
2019-07-21 11:15 ` Fernando Fernandez Mancera
2019-07-21 11:29 ` Phil Sutter
2019-07-20 19:43 ` [nft PATCH 1/2] parser_bison: Get rid of (most) bison compiler warnings Florian Westphal
2019-07-20 20:13 ` Phil Sutter
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=20190720202240.GH32501@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.