]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: check for NULLs in vty code
authorMark Stapp <mjs@labn.net>
Fri, 30 Jun 2023 13:44:00 +0000 (09:44 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sun, 2 Jul 2023 19:40:57 +0000 (19:40 +0000)
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 <mjs@labn.net>
(cherry picked from commit 864a3bc1855ec8027fec8d6f400adb44e1ecbfcf)

ospfd/ospf_ldp_sync.c
ospfd/ospf_vty.c

index 77e96f1733872af000af99e4100dad2981d2ee83..2f0884bb5b20fcef17311c4ff68d374b178a0673 100644 (file)
@@ -658,6 +658,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();
@@ -693,6 +696,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();
index ed3d09b1bd6e51eb6dfe5e6765a2011eba28dbe0..7798eaf84bbd4c45b25390f9b79289e8d8ecf213 100644 (file)
@@ -4096,6 +4096,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();