]> git.puffer.fish Git - mirror/frr.git/commitdiff
pbrd: remove potential null dereference
authorQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 17 Apr 2018 21:59:47 +0000 (17:59 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 18 Apr 2018 16:16:19 +0000 (12:16 -0400)
Coverity #1467832

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

index 1ce8c2104d249a9221d579f0f524ac9210b5e432..4a420c3e8481c85d227b965ccc5db9d362c2aad5 100644 (file)
@@ -209,6 +209,13 @@ void pbr_nhgroup_add_cb(const char *name)
        struct nexthop_group_cmd *nhgc;
 
        nhgc = nhgc_find(name);
+
+       if (!nhgc) {
+               DEBUGD(&pbr_dbg_nht, "%s: Could not find nhgc with name: %s\n",
+                      __PRETTY_FUNCTION__, name);
+               return;
+       }
+
        pnhgc = pbr_nht_add_group(name);
 
        DEBUGD(&pbr_dbg_nht, "%s: Added nexthop-group %s", __PRETTY_FUNCTION__,