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 21c9e49..dc70260 100644
--- a/iptables.c
+++ b/iptables.c
@@ -268,6 +268,7 @@ dotted_to_addr(const char *dotted)
/* copy dotted string, because we need to modify it */
strncpy(buf, dotted, sizeof(buf) - 1);
+ buf[sizeof(buf) - 1] = '\0';
addrp = (unsigned char *) &(addr.s_addr);
p = buf;