summaryrefslogtreecommitdiff
path: root/lib/command_match.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@nvidia.com>2021-09-15 11:43:37 -0400
committerGitHub <noreply@github.com>2021-09-15 11:43:37 -0400
commitbc4477ecbdca408c8a3757f687fd18564af754ec (patch)
treea59f9bcf5bfd0c0d1da3f7e52864f517f852d1c6 /lib/command_match.c
parentaae2caea77c46eafabb050e80b9d530efe829db2 (diff)
parent6ccb661c089b1b377f799018cd5e0e088a9876a3 (diff)
Merge pull request #9608 from idryzhov/vtysh-segfault
lib: fix segfault on question mark on empty line
Diffstat (limited to 'lib/command_match.c')
-rw-r--r--lib/command_match.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/command_match.c b/lib/command_match.c
index 56a7ae422b..f221e0a02c 100644
--- a/lib/command_match.c
+++ b/lib/command_match.c
@@ -81,7 +81,7 @@ static enum match_type match_mac(const char *, bool);
static bool is_neg(vector vline, size_t idx)
{
- if (idx >= vector_active(vline))
+ if (idx >= vector_active(vline) || !vector_slot(vline, idx))
return false;
return !strcmp(vector_slot(vline, idx), "no");
}