mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 23:30:54 +00:00
bgpd: Cleanup SA error in ignoring return from function
Ignoring the return from argv_find_and_parse_afi makes the SA system assume that you could pass a AFI_MAX value to bgp_show_route. Which in turn would cause an array out of bounds read. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
2fd89ed7fc
commit
ff6566f3ef
@ -10569,12 +10569,17 @@ DEFUN (show_bgp_afi_vpn_rd_route,
|
||||
afi_t afi = AFI_MAX;
|
||||
int idx = 0;
|
||||
|
||||
(void)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;
|
||||
}
|
||||
|
||||
ret = str2prefix_rd(argv[5]->arg, &prd);
|
||||
if (!ret) {
|
||||
vty_out(vty, "%% Malformed Route Distinguisher\n");
|
||||
return CMD_WARNING;
|
||||
}
|
||||
|
||||
return bgp_show_route(vty, NULL, argv[6]->arg, afi, SAFI_MPLS_VPN, &prd,
|
||||
0, BGP_PATH_ALL, use_json(argc, argv));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user