From: Pablo Neira Ayuso <pablo@netfilter.org>
To: "Pablo M. Bermudo Garay" <pablombg@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH iptables 1/2] xtables-translate: add escape_quotes option to comment_xlate
Date: Thu, 18 Aug 2016 18:10:21 +0200 [thread overview]
Message-ID: <20160818161021.GA1018@salvia> (raw)
In-Reply-To: <CAAaDf4vWgD74bME7fBjErHud6zV0=tWrOf6ouNe_GHiEUFYU+Q@mail.gmail.com>
On Thu, Aug 18, 2016 at 05:59:30PM +0200, Pablo M. Bermudo Garay wrote:
> 2016-08-17 16:23 GMT+02:00 Pablo Neira Ayuso <pablo@netfilter.org>:
> > On Tue, Aug 16, 2016 at 07:44:32PM +0200, Pablo M. Bermudo Garay wrote:
> >> The comment_xlate function was not supporting this option that is
> >> necessary in some situations.
> >
> > I have applied what I'm attaching to this email, that is more simple
> > than this and makes sure buffer is nul-terminated (given snprintf
> > doesn't guarantee this).
>
> Ok, the simplification seems great. But AFAIK both standards (C99+ and
> POSIX.1-2001+) guarantee that the string will be null-terminated. Am I
> wrong about that?
If you write as many bytes as you can fit into the buffer, then
snprintf doesn't guarantee a nul-terminated string.
prev parent reply other threads:[~2016-08-19 8:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-16 17:44 [PATCH iptables 1/2] xtables-translate: add escape_quotes option to comment_xlate Pablo M. Bermudo Garay
2016-08-16 17:44 ` [PATCH iptables 2/2] xtables-translate-restore: do not escape quotes Pablo M. Bermudo Garay
2016-08-17 14:28 ` Pablo Neira Ayuso
2016-08-17 14:23 ` [PATCH iptables 1/2] xtables-translate: add escape_quotes option to comment_xlate Pablo Neira Ayuso
2016-08-18 15:59 ` Pablo M. Bermudo Garay
2016-08-18 16:10 ` Pablo Neira Ayuso [this message]
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=20160818161021.GA1018@salvia \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablombg@gmail.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 NNTP newsgroup(s).