]> 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:56 +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 51cd2a127b3f839242b0bfb00b422c2ad7745957..89ad0ba23cfac0fce0c65cb2880e2e35d53a32b7 100644 (file)
@@ -651,6 +651,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();
@@ -686,6 +689,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 cdfc54660870456358a1dd3cde3cd0b13ef70e89..660933bd86244a4ec2ae728a939c69aee583bf48 100644 (file)
@@ -4094,6 +4094,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();