]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Prevent null deref 7809/head
authorDonald Sharp <sharpd@nvidia.com>
Mon, 4 Jan 2021 12:56:47 +0000 (07:56 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 4 Jan 2021 12:56:47 +0000 (07:56 -0500)
There exists a path where we could possibly have a NULL deref
of a pointer.  Prevent this from happening.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_nb_config.c

index 6ee8b25b823aad7be31eb2e14b717d13a9547365..ec3b0c13a1fc0c6841f0fc4445cc5f2113c3f6a4 100644 (file)
@@ -6292,7 +6292,11 @@ static struct peer *bgp_peer_group_peer_lookup(struct bgp *bgp,
        struct peer_group *group = NULL;
 
        group = peer_group_lookup(bgp, peer_str);
-       return group->conf;
+
+       if (group)
+               return group->conf;
+
+       return NULL;
 }
 
 /*