summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-21 00:19:55 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-21 00:19:55 +0000
commite02f9f682237b67a54d279e86421f63621944bd7 (patch)
treeee9c2eea958a22a131b45d8f7c146d368c7b1098
parenteac56f78004e6fc7e746a743c1159c49c62aac5b (diff)
bail out early, skip snprintf, if buflen is 0; ok cloder
-rw-r--r--libexec/telnetd/global.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libexec/telnetd/global.c b/libexec/telnetd/global.c
index 841fbb5ae80..395102757f8 100644
--- a/libexec/telnetd/global.c
+++ b/libexec/telnetd/global.c
@@ -93,6 +93,8 @@ output_data (const char *format, ...)
va_start(args, format);
remaining = BUFSIZ - (nfrontp - netobuf);
+ if (remaining == 0)
+ return remaining;
if ((n = vsnprintf(nfrontp, remaining, format, args)) >= remaining || n < 0)
n = strlen(nfrontp);
nfrontp += n;