From 401b063670bed50393815f3071f7816c14bb0155 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 16 Oct 2019 11:03:49 -0400 Subject: [PATCH] bgpd: In redistribution aspath cannot be NULL Coverity has found a path where the attr.aspath may be NULL. assert that the aspath is non-null so we can make this go away. Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index f84956fecc..6bcb244e3b 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -6709,6 +6709,10 @@ void bgp_redistribute_add(struct bgp *bgp, struct prefix *p, /* Make default attribute. */ bgp_attr_default_set(&attr, BGP_ORIGIN_INCOMPLETE); + /* + * This must not be NULL to satisfy Coverity SA + */ + assert(attr.aspath); switch (nhtype) { case NEXTHOP_TYPE_IFINDEX: -- 2.39.5