]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: In redistribution aspath cannot be NULL
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 16 Oct 2019 15:03:49 +0000 (11:03 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 16 Oct 2019 17:38:29 +0000 (13:38 -0400)
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 <sharpd@cumulusnetworks.com>
bgpd/bgp_route.c

index f84956fecceabc6aabcbc5b4185948ef8001da30..6bcb244e3b3a0c2e1eb91d7fcacfc3b84fa5c276 100644 (file)
@@ -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: