]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Prevent Null string %s issues 6767/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 18 Jul 2020 13:46:06 +0000 (09:46 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 18 Jul 2020 13:46:06 +0000 (09:46 -0400)
There are couple spots where group may be NULL and
when we output strings associated with it we should
ensure we are not doing something stupid.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_cmd.c

index 6ede015a0e184ceaef5a0ffae2f85d954063c9c6..db3f0b8b234903d317f6d372509c5aadbb574bd8 100644 (file)
@@ -6784,12 +6784,13 @@ static int pim_rp_cmd_worker(struct pim_instance *pim, struct vty *vty,
 
        if (result == PIM_GROUP_BAD_ADDR_MASK_COMBO) {
                vty_out(vty, "%% Inconsistent address and mask: %s\n",
-                       group);
+                       group ? group : "No Group Address");
                return CMD_WARNING_CONFIG_FAILED;
        }
 
        if (result == PIM_GROUP_BAD_ADDRESS) {
-               vty_out(vty, "%% Bad group address specified: %s\n", group);
+               vty_out(vty, "%% Bad group address specified: %s\n",
+                       group ? group : "No Group Address");
                return CMD_WARNING_CONFIG_FAILED;
        }
 
@@ -7158,7 +7159,8 @@ static int pim_no_rp_cmd_worker(struct pim_instance *pim, struct vty *vty,
        int result = pim_rp_del_config(pim, rp, group, plist);
 
        if (result == PIM_GROUP_BAD_ADDRESS) {
-               vty_out(vty, "%% Bad group address specified: %s\n", group);
+               vty_out(vty, "%% Bad group address specified: %s\n",
+                       group ? group : "No Group Address");
                return CMD_WARNING_CONFIG_FAILED;
        }