summaryrefslogtreecommitdiff
path: root/bfdd
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-11-10 16:36:15 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-11-10 16:36:15 +0300
commitc3634e4411e51984af7ec2f53bc871d9e45ee448 (patch)
tree828d375f9d7881fa0a0be17946ce480e048a30bd /bfdd
parentb6380d60c78639941192c2194269fc1c21b6db81 (diff)
bfdd: fix coverity warnings
show/clear DEFUNs always require either peer label or IP address to be specified, so if `label` is NULL then `peer_str` is definitely not NULL. But Coverity doesn't know about that, so it complains about possible NULL dereference of `peer_str`. This commit should make Coverity happy. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'bfdd')
-rw-r--r--bfdd/bfdd_vty.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bfdd/bfdd_vty.c b/bfdd/bfdd_vty.c
index a03fb9f216..4091ab9caa 100644
--- a/bfdd/bfdd_vty.c
+++ b/bfdd/bfdd_vty.c
@@ -579,7 +579,7 @@ _find_peer_or_error(struct vty *vty, int argc, struct cmd_token **argv,
pl = pl_find(label);
if (pl)
bs = pl->pl_bs;
- } else {
+ } else if (peer_str) {
strtosa(peer_str, &psa);
if (local_str) {
strtosa(local_str, &lsa);
@@ -599,6 +599,9 @@ _find_peer_or_error(struct vty *vty, int argc, struct cmd_token **argv,
}
bs = bs_peer_find(&bpc);
+ } else {
+ vty_out(vty, "%% Invalid arguments\n");
+ return NULL;
}
/* Find peer data. */