summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-07-19 16:02:20 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-07-19 16:02:20 +0000
commit6ca596ed188cecdcde766697f43519feef92af36 (patch)
tree6ad01d5710ccc45762a2871d23faaa9178facb31
parentea714e6697e3611ee332fa8edf779fe8766680ad (diff)
vsnprintf() can return a value larger than the buffer size. from assar
-rw-r--r--libexec/telnetd/global.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libexec/telnetd/global.c b/libexec/telnetd/global.c
index 4b37c22a3c0..63c2b57812d 100644
--- a/libexec/telnetd/global.c
+++ b/libexec/telnetd/global.c
@@ -101,7 +101,7 @@ output_data (const char *format, ...)
remaining,
format,
args);
- nfrontp += ret;
+ nfrontp += ((ret < remaining - 1) ? ret : remaining - 1);
va_end(args);
return ret;
}