summaryrefslogtreecommitdiff
path: root/vtysh
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-10-19 14:38:48 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-10-19 22:28:45 -0400
commit2d35a720b9f997d08dd3da5441fc7ce889135a05 (patch)
treee1a1ee1a5e177dc98786689244dfb82489e46a77 /vtysh
parent41246cb61418102f9f3bfa3e0acfce90c7798e67 (diff)
vtysh: fix oversight in vtysh buffer rewrite
end can be NULL and shouldn't be adjusted in that case. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/vtysh.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index aaf3f828c4..4b579ddbdb 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -185,7 +185,8 @@ vtysh_client_run (struct vtysh_client *vclient, const char *line, FILE *fp)
memmove (buf, eol, bufvalid - eol);
bufvalid -= eol - buf;
- end -= eol - buf;
+ if (end)
+ end -= eol - buf;
}
if (bufvalid == buf + bufsz)