From 5ec72f956062105f6a8a7e753db11e835ba897af Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Fri, 30 Jun 2023 09:44:00 -0400 Subject: [PATCH] ospfd: check for NULLs in vty code There were a couple of cli paths that NULL-checked in the vtysh output path, but not in the json path. Signed-off-by: Mark Stapp (cherry picked from commit 864a3bc1855ec8027fec8d6f400adb44e1ecbfcf) --- ospfd/ospf_ldp_sync.c | 6 ++++++ ospfd/ospf_vty.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ospfd/ospf_ldp_sync.c b/ospfd/ospf_ldp_sync.c index b97e87faa092..4aab880d2280 100644 --- a/ospfd/ospf_ldp_sync.c +++ b/ospfd/ospf_ldp_sync.c @@ -637,6 +637,9 @@ static int show_ip_ospf_mpls_ldp_interface_common(struct vty *vty, rn = route_next(rn)) { oi = rn->info; + if (oi == NULL) + continue; + if (use_json) { json_interface_sub = json_object_new_object(); @@ -672,6 +675,9 @@ static int show_ip_ospf_mpls_ldp_interface_common(struct vty *vty, rn = route_next(rn)) { oi = rn->info; + if (oi == NULL) + continue; + if (use_json) json_interface_sub = json_object_new_object(); diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 0ee42e0e70e9..5cd70c7c2241 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -4175,6 +4175,9 @@ static int show_ip_ospf_interface_traffic_common( rn = route_next(rn)) { oi = rn->info; + if (oi == NULL) + continue; + if (use_json) { json_interface_sub = json_object_new_object();