Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: fix some coverity scan issues #1554

Merged
merged 2 commits into from
Dec 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions bgpd/rfapi/bgp_rfapi_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,11 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
return CMD_WARNING_CONFIG_FAILED;
}

argv_find_and_parse_afi(argv, argc, &idx, &afi);
if (!argv_find_and_parse_afi(argv, argc, &idx, &afi)) {
vty_out(vty, "%% Malformed Address Family\n");
return CMD_WARNING_CONFIG_FAILED;
}

if (argv[idx-1]->text[0] == 'z')
is_bgp = 0;
idx += 2; /* skip afi and keyword */
Expand Down Expand Up @@ -1691,7 +1695,11 @@ DEFUN (vnc_nve_group_export_prefixlist,
return CMD_WARNING_CONFIG_FAILED;
}

argv_find_and_parse_afi(argv, argc, &idx, &afi);
if (!argv_find_and_parse_afi(argv, argc, &idx, &afi)) {
vty_out(vty, "%% Malformed Address Family\n");
return CMD_WARNING_CONFIG_FAILED;
}

if (argv[idx-1]->text[0] == 'z')
is_bgp = 0;
idx = argc - 1;
Expand Down
2 changes: 1 addition & 1 deletion bgpd/rfapi/rfapi_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ void rfapiPrintRd(struct vty *vty, struct prefix_rd *prd)
{
char buf[RD_ADDRSTRLEN];

prefix_rd2str(prd, buf, BUFSIZ);
prefix_rd2str(prd, buf, sizeof(buf));
vty_out(vty, "%s", buf);
}

Expand Down