diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2022-11-28 10:31:58 +0100 | 
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2023-02-10 10:27:23 +0100 | 
| commit | f7b60a3a1fd91846e8f4096073d8e57cb4cf3d8f (patch) | |
| tree | 4e29f43aaa537584f4178db72925a5587bb0cf28 /bgpd/bgp_evpn_mh.c | |
| parent | 8650fef03e736b4209a8acb6cb3cf022be0aabb8 (diff) | |
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.c | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c index dd40a072f9..29a4058ded 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)) {  | 
