]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Ensure that bgp_delete bgp pointer is non-null 2407/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 12 Jun 2018 19:10:01 +0000 (15:10 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 12 Jun 2018 19:12:48 +0000 (15:12 -0400)
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 <sharpd@cumulusnetworks.com>
bgpd/bgpd.c

index 5d858ae14fa1a3385160d230ebb65c5c43010fed..f8903ea568528123d0dc9f8444ca2b442b906ffc 100644 (file)
@@ -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)) {