From: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: pablo@netfilter.org
Subject: [libnftnl PATCH] ruleset: fix erroneus call to snprintf
Date: Tue, 06 May 2014 17:09:33 +0200 [thread overview]
Message-ID: <20140506150933.31175.48901.stgit@nfdev.cica.es> (raw)
This snprintf call is taking an erroneus value for size.
Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
src/ruleset.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ruleset.c b/src/ruleset.c
index 98c4367..a19cbc1 100644
--- a/src/ruleset.c
+++ b/src/ruleset.c
@@ -825,7 +825,7 @@ nft_ruleset_do_snprintf(char *buf, size_t size, const struct nft_ruleset *rs,
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
}
- ret = snprintf(buf+offset, size, "%s", nft_ruleset_o_closetag(type));
+ ret = snprintf(buf+offset, len, "%s", nft_ruleset_o_closetag(type));
SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
ret = nft_event_footer_snprintf(buf+offset, len, type, flags);
next reply other threads:[~2014-05-06 15:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-06 15:09 Arturo Borrero Gonzalez [this message]
2014-05-06 15:53 ` [libnftnl PATCH] ruleset: fix erroneus call to snprintf Arturo Borrero Gonzalez
2014-05-07 13:39 ` Pablo Neira Ayuso
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=20140506150933.31175.48901.stgit@nfdev.cica.es \
--to=arturo.borrero.glez@gmail.com \
--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 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).