]> granicus.if.org Git - ipset/commitdiff
Replace strncpy with strlcpy at creating a set.
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 14 Jan 2011 16:24:38 +0000 (17:24 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 14 Jan 2011 16:24:38 +0000 (17:24 +0100)
Better add more safety nets against user input.

kernel/ip_set_core.c

index 178633ed9a8eb1542b2763390c01c6de1b6c3cfc..21cfc0f4b3dee6ded68f07b86b15449bb97be313 100644 (file)
@@ -556,7 +556,7 @@ ip_set_create(struct sock *ctnl, struct sk_buff *skb,
        if (!set)
                return -ENOMEM;
        rwlock_init(&set->lock);
-       strncpy(set->name, name, IPSET_MAXNAMELEN);
+       strlcpy(set->name, name, IPSET_MAXNAMELEN);
        atomic_set(&set->ref, 0);
        set->family = family;