summaryrefslogtreecommitdiffstats
path: root/pimd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2020-07-18 15:46:06 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2020-07-18 15:46:06 +0200
commitd76c38ade314bcdc58c2ff69f3b9c80ddf2293d2 (patch)
tree4e4e12631182451bb91b3c294704a1c29bd575e5 /pimd
parentzebra: Possible write beyond buffer length (diff)
downloadfrr-d76c38ade314bcdc58c2ff69f3b9c80ddf2293d2.tar.xz
frr-d76c38ade314bcdc58c2ff69f3b9c80ddf2293d2.zip
pimd: Prevent Null string %s issues
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>
Diffstat (limited to 'pimd')
-rw-r--r--pimd/pim_cmd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 6ede015a0..db3f0b8b2 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -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;
}