summaryrefslogtreecommitdiff
path: root/lib/command_match.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-09-14 15:12:23 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-09-14 15:12:23 +0300
commit6ccb661c089b1b377f799018cd5e0e088a9876a3 (patch)
tree114bbefa2a36913a14205f936be9e510cc97e45f /lib/command_match.c
parent28e577efbece74eff01930a70dba1e1e6beb1df4 (diff)
lib: fix segfault on question mark on empty line
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
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");
}