summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-07-19 18:58:31 +0000
committerru <ru@FreeBSD.org>2001-07-19 18:58:31 +0000
commit5bfe15ad2feeee42e241fffa07c5a9b1fdaf5751 (patch)
tree0346cc2ad7935c7c0e82f72f9b81bf98cee489f8 /crypto
parent303231dd3fd16964c4a7ce80d6dd151b45e87f2f (diff)
downloadFreeBSD-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 'crypto')
-rw-r--r--crypto/telnet/telnetd/state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/telnet/telnetd/state.c b/crypto/telnet/telnetd/state.c
index ec012cf..1346c95 100644
--- a/crypto/telnet/telnetd/state.c
+++ b/crypto/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;
}
OpenPOWER on IntegriCloud