genetlink: trigger BUG_ON if a group name is too long
authorMasatake YAMATO <yamato@redhat.com>
Tue, 19 Mar 2013 01:47:27 +0000 (01:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Mar 2013 16:05:51 +0000 (12:05 -0400)
Trigger BUG_ON if a group name is longer than GENL_NAMSIZ.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/genetlink.c

index f2aabb6f410582439604d7a3c0f379a5cd798621..5a55be3f17a54aa2acac3ce109c412c86c652b36 100644 (file)
@@ -142,6 +142,7 @@ int genl_register_mc_group(struct genl_family *family,
        int err = 0;
 
        BUG_ON(grp->name[0] == '\0');
+       BUG_ON(memchr(grp->name, '\0', GENL_NAMSIZ) == NULL);
 
        genl_lock();