Skip to contentSkip to conversation

ruleset: fix erroneus call to snprintf

PATCH In review Arturo Borrero Gonzalez 2 participants 3 messages May 6, 2014 – May 7, 2014 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ruleset: fix erroneus call to snprintf

This snprintf call is taking an erroneus value for size.

---
 src/ruleset.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/ruleset.c +1 -1
index 98c4367..a19cbc1 100644
@@ -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);
#1 lore raw
Quoted 2 lines · Arturo Borrero Gonzalez

This snprintf call is taking an erroneus value for size.

Please Pablo fix the message if you apply this. erroneus -> erroneous.

thanks, regards.

Signature · 5 lines
Arturo Borrero González
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 6 lines · Arturo Borrero Gonzalez
Quoted 2 lines · Arturo Borrero Gonzalez

This snprintf call is taking an erroneus value for size.

Please Pablo fix the message if you apply this. erroneus -> erroneous.

Fixed and applied, thanks.