From: Donald Sharp Date: Mon, 27 Jul 2020 10:59:45 +0000 (-0400) Subject: bgpd: Prevent Null pointer usage X-Git-Tag: base_7.5~154^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7b3a38053141a3ebfc5b039bc191c5e08d8b9cef;p=mirror%2Ffrr.git bgpd: Prevent Null pointer usage Coverity rightly points out that bgp_table_top might return NULL and immediately deref'ing it might be a problem. Add a bit of safety. Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index db330f998c..af88547ca9 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -951,8 +951,11 @@ afibreak: /* initialize syncrdpos to the first * mid-layer table entry */ - if (!bmp->syncrdpos) + if (!bmp->syncrdpos) { bmp->syncrdpos = bgp_table_top(table); + if (!bmp->syncrdpos) + goto eor; + } /* look for a valid mid-layer table */ do {