summaryrefslogtreecommitdiffstats
path: root/src/plugins/abf/abf_api.c
diff options
context:
space:
mode:
authorJon Loeliger <jdl@netgate.com>2022-09-12 12:41:06 -0500
committerNeale Ranns <neale@graphiant.com>2022-09-19 01:39:05 +0000
commit755b529c11d37f839dfba91127657a47390b88a2 (patch)
tree0fc26749d794d070c721e65ce4768b80021610c1 /src/plugins/abf/abf_api.c
parent6e3b3b76727c629b478e9ff9ed8836e595650a18 (diff)
abf: add API parameter n_paths range checks
Also check for non-zero rpath length in CLI cmd. While there, no need to use "else" after a return. Also while there, notice and fix numerous input_line buffer leaks and fix them. Type: fix Fixes: 669d07dc016757b856e1014a415996cf9f0ebc58 Signed-off-by: Jon Loeliger <jdl@netgate.com> Change-Id: I18ea44b7b82e8938c3e793e7c2a04dfe157076d8
Diffstat (limited to 'src/plugins/abf/abf_api.c')
-rw-r--r--src/plugins/abf/abf_api.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/abf/abf_api.c b/src/plugins/abf/abf_api.c
index 66121acbdf0..222e1f4e116 100644
--- a/src/plugins/abf/abf_api.c
+++ b/src/plugins/abf/abf_api.c
@@ -69,6 +69,12 @@ vl_api_abf_policy_add_del_t_handler (vl_api_abf_policy_add_del_t * mp)
int rv = 0;
u8 pi;
+ if (mp->policy.n_paths == 0)
+ {
+ rv = VNET_API_ERROR_INVALID_VALUE;
+ goto done;
+ }
+
vec_validate (paths, mp->policy.n_paths - 1);
for (pi = 0; pi < mp->policy.n_paths; pi++)