lib: limit size of vty buffer to 4096 bytes

This removes the automatic resizing of the vty input buffer and places a
hard size cap of 4096 bytes. It also fixes a potentially unsafe strcpy.

[Edits by Paul Jakma, paul@jakma.org]
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 2e2203d..7068ea3 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -443,7 +443,7 @@
   int ret;
   struct cmd_element *cmd;
 
-  while (fgets (vty->buf, VTY_BUFSIZ, fp))
+  while (fgets (vty->buf, vty->max, fp))
     {
       ret = command_config_read_one_line (vty, &cmd, 1);