]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: avoid writing to negative fd
authorQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 17 Apr 2018 20:36:56 +0000 (16:36 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 18 Apr 2018 16:16:19 +0000 (12:16 -0400)
Coverty #1465483

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
pimd/mtracebis_routeget.c

index d75aaa3708bb5e6436552dcfb30056442b257857..8c1cd8d96303b03995347409b10db6ddd3960986 100644 (file)
@@ -81,7 +81,7 @@ int routeget(struct in_addr dst, struct in_addr *src, struct in_addr *gw)
 
        ret = rtnl_open(&rth, 0);
 
-       if (ret < 0)
+       if (ret < 0 || rth.fd <= 0)
                return ret;
 
        if (rtnl_talk(&rth, &req.n, 0, 0, &req.n, NULL, NULL) < 0) {