All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Phil Sutter <phil@nwl.cc>
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 21:36:28 +0200	[thread overview]
Message-ID: <20190720193628.fysp5cdofer2vi32@breakpoint.cc> (raw)
In-Reply-To: <20190720185226.8876-2-phil@nwl.cc>

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.


  reply	other threads:[~2019-07-20 19:36 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 [this message]
2019-07-20 20:22     ` Phil Sutter
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=20190720193628.fysp5cdofer2vi32@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=phil@nwl.cc \
    /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.