summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_evpn_mh.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2022-11-28 10:31:58 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2023-02-10 10:27:23 +0100
commitf7b60a3a1fd91846e8f4096073d8e57cb4cf3d8f (patch)
tree4e29f43aaa537584f4178db72925a5587bb0cf28 /bgpd/bgp_evpn_mh.c
parenttopotests: add bgp_asdot_regex test (diff)
downloadfrr-f7b60a3a1fd91846e8f4096073d8e57cb4cf3d8f.tar.xz
frr-f7b60a3a1fd91846e8f4096073d8e57cb4cf3d8f.zip
bgpd: fix dereference of null pointer in 'bgp_evpn_es_evi_show_entry'
The bgp_evpn_es_evi_show_entry() function tries to access the vni attribute, while the vpn structure may be null. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_evpn_mh.c')
-rw-r--r--bgpd/bgp_evpn_mh.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c
index dd40a072f..29a4058de 100644
--- a/bgpd/bgp_evpn_mh.c
+++ b/bgpd/bgp_evpn_mh.c
@@ -3966,7 +3966,8 @@ static void bgp_evpn_es_evi_show_entry(struct vty *vty,
json_object *json_types;
json_object_string_add(json, "esi", es_evi->es->esi_str);
- json_object_int_add(json, "vni", es_evi->vpn->vni);
+ if (es_evi->vpn)
+ json_object_int_add(json, "vni", es_evi->vpn->vni);
if (es_evi->flags & (BGP_EVPNES_EVI_LOCAL |
BGP_EVPNES_EVI_REMOTE)) {