From: Donald Sharp Date: Mon, 4 Jan 2021 12:56:47 +0000 (-0500) Subject: bgpd: Prevent null deref X-Git-Tag: base_7.6~93^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F7809%2Fhead;p=mirror%2Ffrr.git bgpd: Prevent null deref There exists a path where we could possibly have a NULL deref of a pointer. Prevent this from happening. Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgp_nb_config.c b/bgpd/bgp_nb_config.c index 6ee8b25b82..ec3b0c13a1 100644 --- a/bgpd/bgp_nb_config.c +++ b/bgpd/bgp_nb_config.c @@ -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; } /*