summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vty/vty.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vty/vty.c b/src/vty/vty.c
index 98b332d6..b1bb3f49 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -1416,6 +1416,8 @@ int vty_read(struct vty *vty)
case '\n':
case '\r':
vty_out(vty, "%s", VTY_NEWLINE);
+ /* '\0'-terminate the command buffer */
+ vty->buf[vty->length] = '\0';
vty_execute(vty);
break;
case '\t':