From: Karsten Desler Date: Sat, 31 Jan 2004 13:22:18 +0000 (+0000) Subject: Fix possibly not zero-terminated string after copy (Karsten Desler) X-Git-Tag: v1.3.0-rc1~144 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9cc354fb9cf898ef78e7e817a0464c60dbed3b6e;p=thirdparty%2Fiptables.git Fix possibly not zero-terminated string after copy (Karsten Desler) --- diff --git a/iptables.c b/iptables.c index 21c9e49d..dc702608 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;