commit | b7ceefea77a246fe5c1dcd1b91bf6079d1b97c02 | [log] [tgz] |
---|---|---|
author | Quentin Young <qlyoung@cumulusnetworks.com> | Tue Jan 10 23:33:50 2017 +0000 |
committer | Paul Jakma <paul@quagga.net> | Fri Jan 20 12:25:22 2017 +0000 |
tree | a67ab3ef89e499e8ff7d8d044f6ee2837ca75f0d | |
parent | 5477ee7b9d8d24d2bb61335c62f3d6c5e99fc901 [diff] [blame] |
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/lib/command.c b/lib/command.c index ab46fc4..242c98b 100644 --- a/lib/command.c +++ b/lib/command.c
@@ -2901,7 +2901,7 @@ int ret; *line_num = 0; - while (fgets (vty->buf, VTY_BUFSIZ, fp)) + while (fgets (vty->buf, vty->max, fp)) { ++(*line_num);