]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: fix segfault on question mark on empty line 9608/head
authorIgor Ryzhov <iryzhov@nfware.com>
Tue, 14 Sep 2021 12:12:23 +0000 (15:12 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 14 Sep 2021 12:12:23 +0000 (15:12 +0300)
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
lib/command_match.c

index 56a7ae422b4e03e8b497bb156eb657f1d851da83..f221e0a02ce7ebfc846d93b81dab1a5a0d0de85d 100644 (file)
@@ -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");
 }