]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: null check (Coverity 23106)
authorpaco <paco@voltanet.io>
Thu, 21 Jun 2018 13:58:51 +0000 (15:58 +0200)
committerpaco <paco@voltanet.io>
Thu, 21 Jun 2018 13:58:51 +0000 (15:58 +0200)
Signed-off-by: F. Aragon <paco@voltanet.io>
bgpd/bgp_aspath.c
bgpd/bgp_attr.c

index e02617691fa783a402fca224740a6ec51100e5c5..05e67baa8a83140277a6274568e1e755034eae4c 100644 (file)
@@ -1632,7 +1632,7 @@ struct aspath *aspath_reconcile_as4(struct aspath *aspath,
        struct aspath *newpath = NULL, *mergedpath;
        int hops, cpasns = 0;
 
-       if (!aspath)
+       if (!aspath || !as4path)
                return NULL;
 
        seg = aspath->segments;
index 2c52b57b36f8e7c370e57cc5336d0c42087e4389..6596e7cfa2643d1e4b650ecdeb4d5705d3762230 100644 (file)
@@ -1513,6 +1513,9 @@ bgp_attr_munge_as4_attrs(struct peer *const peer, struct attr *const attr,
        if (!ignore_as4_path
            && (attr->flag & (ATTR_FLAG_BIT(BGP_ATTR_AS4_PATH)))) {
                newpath = aspath_reconcile_as4(attr->aspath, as4_path);
+               if (!newpath)
+                       return BGP_ATTR_PARSE_ERROR;
+
                aspath_unintern(&attr->aspath);
                attr->aspath = aspath_intern(newpath);
        }