From e8573f0f5748b3c5e5dc610800781b2dfb52882d Mon Sep 17 00:00:00 2001 From: Eric Heien Date: Thu, 5 Jun 2003 22:06:43 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=1311 --- client/client_state.C | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/client_state.C b/client/client_state.C index 6ea19f0be7..e3f67619eb 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -1667,8 +1667,10 @@ void msg_printf(PROJECT *p, int priority, char *fmt, ...) { if (fmt == NULL) return; - // TODO: This is vulnerable to buffer overruns - FIX IT! + // Since Windows doesn't support vsnprintf, we have to do a + // workaround to prevent buffer overruns // + if (strlen(fmt) > 512) fmt[511] = '\0'; va_start(ap, fmt); // Parses string for variables vsprintf(buf, fmt, ap); // And convert symbols To actual numbers va_end(ap); // Results are stored in text