summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--iptables.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/iptables.c b/iptables.c
index dc70260..c438d60 100644
--- a/iptables.c
+++ b/iptables.c
@@ -634,6 +634,7 @@ parse_hostnetworkmask(const char *name, struct in_addr **addrpp,
int i, j, k, n;
strncpy(buf, name, sizeof(buf) - 1);
+ buf[sizeof(buf) - 1] = '\0';
if ((p = strrchr(buf, '/')) != NULL) {
*p = '\0';
addrp = parse_mask(p + 1);