From 6ccb661c089b1b377f799018cd5e0e088a9876a3 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Tue, 14 Sep 2021 15:12:23 +0300 Subject: [PATCH] lib: fix segfault on question mark on empty line Signed-off-by: Igor Ryzhov --- lib/command_match.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); }