]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: correctly store allocated ES struct
authorPat Ruddy <pat@voltanet.io>
Wed, 25 Nov 2020 10:18:45 +0000 (10:18 +0000)
committerPat Ruddy <pat@voltanet.io>
Wed, 25 Nov 2020 18:23:13 +0000 (18:23 +0000)
in the rare situation where we allocate the ES during the path link
we fail to check/store the allocated ES pointer thus leading to a
NULL dereference later in the function.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
bgpd/bgp_evpn_mh.c

index 0494200e34d7707b81e6de799de6024332f08555..4bc53b10e81d727f8aa9ae10f5d5749ce1d8a245 100644 (file)
@@ -1422,7 +1422,7 @@ void bgp_evpn_path_es_link(struct bgp_path_info *pi, vni_t vni, esi_t *esi)
        /* find-create ES */
        es = bgp_evpn_es_find(esi);
        if (!es)
-               bgp_evpn_es_new(bgp_evpn, esi);
+               es = bgp_evpn_es_new(bgp_evpn, esi);
 
        /* dup check */
        if (es_info->es == es)