]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Fix possibly not zero-terminated string after copy (Karsten Desler)
authorKarsten Desler <kdesler@soohrt.org>
Sat, 31 Jan 2004 13:22:18 +0000 (13:22 +0000)
committerMartin Josefsson <gandalf@wlug.westbo.se>
Sat, 31 Jan 2004 13:22:18 +0000 (13:22 +0000)
iptables.c

index 21c9e49d8e2e220af51186f10c9749f153a7c5cb..dc702608b95465776a77ce6a43b8044e9c44b7e4 100644 (file)
@@ -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;