Blame 0008-arptables-fix-potential-buffer-overflow-author-dcb.patch

d8a888d
From 2aa3fc519050787aa05395b3821fbc4ddfe41ac5 Mon Sep 17 00:00:00 2001
d8a888d
From: Bart De Schuymer <bdschuym@pandora.be>
d8a888d
Date: Tue, 6 May 2014 21:07:13 +0200
d8a888d
Subject: [PATCH] arptables: fix potential buffer overflow (author: dcb)
d8a888d
d8a888d
(cherry picked from commit c29948407c6e1960b9ca0ff3f1479773c95d25c9)
d8a888d
Signed-off-by: Phil Sutter <psutter@redhat.com>
d8a888d
---
d8a888d
 arptables.c | 1 +
d8a888d
 1 file changed, 1 insertion(+)
d8a888d
d8a888d
diff --git a/arptables.c b/arptables.c
d8a888d
index 3fb8ed5c40e73..64ac3aa226a2c 100644
d8a888d
--- a/arptables.c
d8a888d
+++ b/arptables.c
d8a888d
@@ -763,6 +763,7 @@ parse_hostnetworkmask(const char *name, struct in_addr **addrpp,
d8a888d
 	int i, j, k, n;
d8a888d
 
d8a888d
 	strncpy(buf, name, sizeof(buf) - 1);
d8a888d
+	buf[sizeof(buf) - 1] = '\0';
d8a888d
 	if ((p = strrchr(buf, '/')) != NULL) {
d8a888d
 		*p = '\0';
d8a888d
 		addrp = parse_mask(p + 1);
d8a888d
-- 
d8a888d
2.21.0
d8a888d