From: Donatas Abraitis Date: Thu, 5 Nov 2020 20:00:39 +0000 (+0200) Subject: bgpd: Check if peer is not NULL before calling peer_as_change() X-Git-Tag: base_7.6~251^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7a68370285ed4d64e1ed9dcab60b17bfb26a0ba4;p=mirror%2Ffrr.git bgpd: Check if peer is not NULL before calling peer_as_change() Prevents NULL possible dereference. Signed-off-by: Donatas Abraitis --- diff --git a/bgpd/bgp_nb_config.c b/bgpd/bgp_nb_config.c index eca7093fcd..8eaedf4e0e 100644 --- a/bgpd/bgp_nb_config.c +++ b/bgpd/bgp_nb_config.c @@ -5214,7 +5214,8 @@ int bgp_neighbors_unnumbered_neighbor_neighbor_remote_as_remote_as_type_destroy( peer = peer_lookup_by_conf_if(bgp, peer_str); /* remote-as set to 0 and as_type to unspecified */ - peer_as_change(peer, 0, AS_UNSPECIFIED); + if (peer) + peer_as_change(peer, 0, AS_UNSPECIFIED); break; }