summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2023-05-23 08:20:07 -0400
committerGitHub <noreply@github.com>2023-05-23 08:20:07 -0400
commit5db30e795871b4665cf05c5a407df966cd39c3f5 (patch)
tree367001227c42daba2d0ead6edabd51fe6574079c
parentfa45a19a60b338f156e552487f4f51bfffabf2a9 (diff)
parenta82a6d409dd5860b7c410799c65984c2629c60f6 (diff)
Merge pull request #13578 from opensourcerouting/fix/ripd_argv_find
ripd: Use argv_find to avoid buffer overflow when parsing allow-ecmp args
-rw-r--r--ripd/rip_cli.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ripd/rip_cli.c b/ripd/rip_cli.c
index 6f45bb5d9e..097c708ab1 100644
--- a/ripd/rip_cli.c
+++ b/ripd/rip_cli.c
@@ -91,11 +91,11 @@ DEFUN_YANG (rip_allow_ecmp,
"Allow Equal Cost MultiPath\n"
"Number of paths\n")
{
- int idx_number = 1;
+ int idx_number = 0;
char mpaths[3] = {};
uint32_t paths = MULTIPATH_NUM;
- if (argv[idx_number])
+ if (argv_find(argv, argc, CMD_RANGE_STR(1, MULTIPATH_NUM), &idx_number))
paths = strtol(argv[idx_number]->arg, NULL, 10);
snprintf(mpaths, sizeof(mpaths), "%u", paths);