summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranton <anton@openbsd.org>2017-08-30 06:57:48 +0000
committeranton <anton@openbsd.org>2017-08-30 06:57:48 +0000
commit7d12c80a544e199bec4fc6d397a0369212f99eb3 (patch)
tree052c7143988d96e8a5722cf6bfbbf40a5eb2144f
parentremove smtp_filter_*() indirections. (diff)
downloadwireguard-openbsd-7d12c80a544e199bec4fc6d397a0369212f99eb3.tar.xz
wireguard-openbsd-7d12c80a544e199bec4fc6d397a0369212f99eb3.zip
Respect inputline_size argument. No functional change since tenex() only has one
call site where `inputline_size == sizeof(buf)`.
-rw-r--r--bin/csh/file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/csh/file.c b/bin/csh/file.c
index 11c6a38a11d..074dce9f937 100644
--- a/bin/csh/file.c
+++ b/bin/csh/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.34 2017/08/30 06:42:21 anton Exp $ */
+/* $OpenBSD: file.c,v 1.35 2017/08/30 06:57:48 anton Exp $ */
/* $NetBSD: file.c,v 1.11 1996/11/08 19:34:37 christos Exp $ */
/*-
@@ -777,6 +777,8 @@ tenex(Char *inputline, int inputline_size)
cl.fdout = SHOUT;
cl.buf = buf;
cl.size = sizeof(buf);
+ if (inputline_size < cl.size)
+ cl.size = inputline_size;
if (tio->c_lflag & ALTWERASE)
cl.flags |= CL_ALTWERASE;
if (needprompt) {