[libnftnl PATCH] ruleset: fix erroneus call to snprintf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This snprintf call is taking an erroneus value for size.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@xxxxxxxxx>
---
 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);

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux