Blame SOURCES/0022-extensions-fix-build-failure-on-fc28.patch

05e71a
From d3724c422da83279eb7550019668c29bbf16592a Mon Sep 17 00:00:00 2001
05e71a
From: Florian Westphal <fw@strlen.de>
05e71a
Date: Wed, 6 Jun 2018 14:21:57 +0200
05e71a
Subject: [PATCH] extensions: fix build failure on fc28
05e71a
MIME-Version: 1.0
05e71a
Content-Type: text/plain; charset=UTF-8
05e71a
Content-Transfer-Encoding: 8bit
05e71a
05e71a
make fails via:
05e71a
extensions/ebt_string.c: In function ‘parse’:
05e71a
extensions/ebt_string.c:171:3: error: ‘strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation]
05e71a
   strncpy(info->algo, optarg, XT_STRING_MAX_ALGO_NAME_SIZE);
05e71a
05e71a
Signed-off-by: Florian Westphal <fw@strlen.de>
05e71a
Signed-off-by: Phil Sutter <psutter@redhat.com>
05e71a
---
05e71a
 extensions/ebt_string.c | 2 +-
05e71a
 1 file changed, 1 insertion(+), 1 deletion(-)
05e71a
05e71a
diff --git a/extensions/ebt_string.c b/extensions/ebt_string.c
05e71a
index 9550c41096a86..3deff1ba83264 100644
05e71a
--- a/extensions/ebt_string.c
05e71a
+++ b/extensions/ebt_string.c
05e71a
@@ -168,7 +168,7 @@ static int parse(int c, char **argv, int argc, const struct ebt_u_entry *entry,
05e71a
 		ebt_check_option2(flags, OPT_STRING_ALGO);
05e71a
 		if (ebt_check_inverse2(optarg))
05e71a
 			ebt_print_error2("Unexpected `!' after --string-algo");
05e71a
-		strncpy(info->algo, optarg, XT_STRING_MAX_ALGO_NAME_SIZE);
05e71a
+		snprintf(info->algo, sizeof(info->algo), "%s", optarg);
05e71a
 		break;
05e71a
 	case STRING_ICASE:
05e71a
 		ebt_check_option2(flags, OPT_STRING_ICASE);
05e71a
-- 
05e71a
2.21.0
05e71a