From bf383464ea317027c5943e678aaabc70d285a04e Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 12 Jun 2018 15:10:01 -0400 Subject: [PATCH] bgpd: Ensure that bgp_delete bgp pointer is non-null Crash w/ an assert if someone calls bgp_delete with a NULL parameter as opposed to crashing when we dereference the pointer a bit later. Signed-off-by: Donald Sharp --- bgpd/bgpd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 5d858ae14f..f8903ea568 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -3300,6 +3300,7 @@ int bgp_delete(struct bgp *bgp) afi_t afi; int i; + assert(bgp); THREAD_OFF(bgp->t_startup); if (BGP_DEBUG(zebra, ZEBRA)) { -- 2.39.5