All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: "Carlos Falgueras García" <carlosfg@riseup.net>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH libnftnl] set: Fix nftnl_set_set_str
Date: Fri, 1 Jul 2016 16:22:47 +0200	[thread overview]
Message-ID: <20160701142247.GA8806@salvia> (raw)
In-Reply-To: <20160627162425.4376-1-carlosfg@riseup.net>

On Mon, Jun 27, 2016 at 06:24:25PM +0200, Carlos Falgueras García wrote:
> We need the string length
> 
> Signed-off-by: Carlos Falgueras García <carlosfg@riseup.net>
> ---
>  src/set.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/set.c b/src/set.c
> index 879100c..edbcbe5 100644
> --- a/src/set.c
> +++ b/src/set.c
> @@ -203,7 +203,7 @@ EXPORT_SYMBOL_ALIAS(nftnl_set_set_u64, nft_set_attr_set_u64);
>  
>  int nftnl_set_set_str(struct nftnl_set *s, uint16_t attr, const char *str)
>  {
> -	return nftnl_set_set(s, attr, str);
> +	return nftnl_set_set_data(s, attr, str, strlen(str));

I think this should be strlen(str) + 1 so we make sure the string is
nul-terminated.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-07-01 14:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-27 16:24 [PATCH libnftnl] set: Fix nftnl_set_set_str Carlos Falgueras García
2016-06-27 16:29 ` Carlos Falgueras García
2016-07-01 14:22 ` Pablo Neira Ayuso [this message]
2016-07-01 16:07   ` [PATCH libnfntl v2] " Carlos Falgueras García
2016-07-01 16:11   ` [PATCH libnftnl] Fix string length calculations Carlos Falgueras García
2016-07-02  6:54     ` Pablo Neira Ayuso
2016-07-03 10:13       ` Carlos Falgueras García
2016-07-05 12:31         ` Pablo Neira Ayuso
2016-07-05 17:15           ` [PATCH 1/2 libnfntl] Fix nftnl_*_set_str Carlos Falgueras García
2016-07-05 17:15             ` [PATCH 2/2 libnfntl] Fix nftnl_*_get to set data_len Carlos Falgueras García
2016-07-06 15:21               ` Pablo Neira Ayuso
2016-07-11 11:41                 ` [PATCH v2, libnftnl] " Carlos Falgueras García
2016-07-11 11:48                   ` Pablo Neira Ayuso
2016-07-11 16:07                     ` [PATCH v3, " Carlos Falgueras García
2016-07-11 17:18                       ` Pablo Neira Ayuso
2016-07-11 10:24               ` [PATCH 2/2 libnfntl] " Pablo Neira Ayuso
2016-07-11 10:25                 ` Pablo Neira Ayuso
2016-07-06 15:19             ` [PATCH 1/2 libnfntl] Fix nftnl_*_set_str Pablo Neira Ayuso
2016-07-01 16:13   ` [PATCH libnftnl] set: Fix nftnl_set_set_str Carlos Falgueras García

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=20160701142247.GA8806@salvia \
    --to=pablo@netfilter.org \
    --cc=carlosfg@riseup.net \
    --cc=netfilter-devel@vger.kernel.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.