]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip vrf: Detect invalid vrf name in pids command
authorDavid Ahern <dsa@cumulusnetworks.com>
Thu, 16 Feb 2017 16:58:58 +0000 (08:58 -0800)
committerStephen Hemminger <sthemmin@microsoft.com>
Fri, 17 Feb 2017 23:33:24 +0000 (15:33 -0800)
Verify VRF name is valid before attempting to read cgroups files.

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
ip/ipvrf.c

index cb7f9fa6d1db3ce800cbfc6be60b28901a0bcc5b..5e204a9ebbb1604f2a2dd559c2d861994807bdc0 100644 (file)
@@ -212,6 +212,10 @@ static int ipvrf_pids(int argc, char **argv)
        }
 
        vrf = argv[0];
+       if (!name_is_vrf(vrf)) {
+               fprintf(stderr, "Invalid VRF name\n");
+               return -1;
+       }
 
        mnt = find_cgroup2_mount();
        if (!mnt)