From 745e2754ef265533ee60106f37c8cc86ef4aa9a5 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Mon, 28 Nov 2016 18:41:34 +0100 Subject: [PATCH] lib: temporary-catch a SEGV in command completion Getting FULL_MATCH with matched[0] == NULL in tests/testcli. Catch and print error for now. Signed-off-by: David Lamparter --- lib/vty.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/vty.c b/lib/vty.c index b27941faaf..54399b0238 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -940,6 +940,14 @@ vty_complete_command (struct vty *vty) vty_redraw_line (vty); break; case CMD_COMPLETE_FULL_MATCH: + if (!matched[0]) + { + /* 2016-11-28 equinox -- need to debug, SEGV here */ + vty_out (vty, "%% CLI BUG: FULL_MATCH with NULL str%s", VTY_NEWLINE); + vty_prompt (vty); + vty_redraw_line (vty); + break; + } vty_prompt (vty); vty_redraw_line (vty); vty_backward_pure_word (vty); -- 2.39.5