diff options
author | ru <ru@FreeBSD.org> | 2001-07-19 18:58:31 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2001-07-19 18:58:31 +0000 |
commit | 5bfe15ad2feeee42e241fffa07c5a9b1fdaf5751 (patch) | |
tree | 0346cc2ad7935c7c0e82f72f9b81bf98cee489f8 /contrib/telnet/telnetd | |
parent | 303231dd3fd16964c4a7ce80d6dd151b45e87f2f (diff) | |
download | FreeBSD-src-5bfe15ad2feeee42e241fffa07c5a9b1fdaf5751.zip FreeBSD-src-5bfe15ad2feeee42e241fffa07c5a9b1fdaf5751.tar.gz |
vsnprintf() can return a value larger than the buffer size.
Submitted by: assar
Obtained from: OpenBSD
Diffstat (limited to 'contrib/telnet/telnetd')
-rw-r--r-- | contrib/telnet/telnetd/state.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/telnet/telnetd/state.c b/contrib/telnet/telnetd/state.c index ec012cf..1346c95 100644 --- a/contrib/telnet/telnetd/state.c +++ b/contrib/telnet/telnetd/state.c @@ -1631,7 +1631,7 @@ output_data(const char *format, ...) remaining = BUFSIZ - (nfrontp - netobuf); } ret = vsnprintf(nfrontp, remaining, format, args); - nfrontp += ret; + nfrontp += ((ret < remaining - 1) ? ret : remaining - 1); va_end(args); return ret; } |