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

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