Blame SOURCES/0003-extensions-format-security-fixes-in-libip-6-t_icmp.patch

1dc35b
From 7e63dd95957a264d15eefdda3ea9449a6c72eb86 Mon Sep 17 00:00:00 2001
8cce6c
From: =?UTF-8?q?Adam=20Go=C5=82=C4=99biowski?= <adamg@pld-linux.org>
8cce6c
Date: Wed, 14 Nov 2018 07:35:28 +0100
8cce6c
Subject: [PATCH] extensions: format-security fixes in libip[6]t_icmp
8cce6c
MIME-Version: 1.0
8cce6c
Content-Type: text/plain; charset=UTF-8
8cce6c
Content-Transfer-Encoding: 8bit
8cce6c
8cce6c
commit 61d6c3834de3 ("xtables: add 'printf' attribute to xlate_add")
8cce6c
introduced support for gcc feature to check format string against passed
8cce6c
argument.  This commit adds missing bits to extenstions's libipt_icmp.c
8cce6c
and libip6t_icmp6.c that were causing build to fail.
8cce6c
8cce6c
Fixes: 61d6c3834de3 ("xtables: add 'printf' attribute to xlate_add")
8cce6c
Signed-off-by: Adam Gołębiowski <adamg@pld-linux.org>
8cce6c
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
8cce6c
(cherry picked from commit 907e429d7548157016cd51aba4adc5d0c7d9f816)
8cce6c
Signed-off-by: Phil Sutter <psutter@redhat.com>
8cce6c
---
8cce6c
 extensions/libip6t_icmp6.c | 4 ++--
8cce6c
 extensions/libipt_icmp.c   | 2 +-
8cce6c
 2 files changed, 3 insertions(+), 3 deletions(-)
8cce6c
8cce6c
diff --git a/extensions/libip6t_icmp6.c b/extensions/libip6t_icmp6.c
8cce6c
index 45a71875722c4..cc7bfaeb72fd7 100644
8cce6c
--- a/extensions/libip6t_icmp6.c
8cce6c
+++ b/extensions/libip6t_icmp6.c
8cce6c
@@ -230,7 +230,7 @@ static unsigned int type_xlate_print(struct xt_xlate *xl, unsigned int icmptype,
8cce6c
 	type_name = icmp6_type_xlate(icmptype);
8cce6c
 
8cce6c
 	if (type_name) {
8cce6c
-		xt_xlate_add(xl, type_name);
8cce6c
+		xt_xlate_add(xl, "%s", type_name);
8cce6c
 	} else {
8cce6c
 		for (i = 0; i < ARRAY_SIZE(icmpv6_codes); ++i)
8cce6c
 			if (icmpv6_codes[i].type == icmptype &&
8cce6c
@@ -239,7 +239,7 @@ static unsigned int type_xlate_print(struct xt_xlate *xl, unsigned int icmptype,
8cce6c
 				break;
8cce6c
 
8cce6c
 		if (i != ARRAY_SIZE(icmpv6_codes))
8cce6c
-			xt_xlate_add(xl, icmpv6_codes[i].name);
8cce6c
+			xt_xlate_add(xl, "%s", icmpv6_codes[i].name);
8cce6c
 		else
8cce6c
 			return 0;
8cce6c
 	}
8cce6c
diff --git a/extensions/libipt_icmp.c b/extensions/libipt_icmp.c
8cce6c
index 5418997668d4c..e76257c54708c 100644
8cce6c
--- a/extensions/libipt_icmp.c
8cce6c
+++ b/extensions/libipt_icmp.c
8cce6c
@@ -236,7 +236,7 @@ static unsigned int type_xlate_print(struct xt_xlate *xl, unsigned int icmptype,
8cce6c
 			if (icmp_codes[i].type == icmptype &&
8cce6c
 			    icmp_codes[i].code_min == code_min &&
8cce6c
 			    icmp_codes[i].code_max == code_max) {
8cce6c
-				xt_xlate_add(xl, icmp_codes[i].name);
8cce6c
+				xt_xlate_add(xl, "%s", icmp_codes[i].name);
8cce6c
 				return 1;
8cce6c
 			}
8cce6c
 	}
8cce6c
-- 
1dc35b
2.21.0
8cce6c