From 1f599f9ec4cc23c03a20a21474b3f8dc4c29eaf4 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 11 Nov 2015 10:55:51 -0800 Subject: [PATCH] Manager: fix crashing bug Don't do fprintf(stdout, msg). If msg contains %, this will crash. Instead do fprintf(stdout, "%s", msg). --- lib/diagnostics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/diagnostics.cpp b/lib/diagnostics.cpp index c10bce57bc..26e791ed1b 100644 --- a/lib/diagnostics.cpp +++ b/lib/diagnostics.cpp @@ -125,12 +125,12 @@ int __cdecl boinc_message_reporting(int reportType, char *szMsg, int *retVal){ case _CRT_ERROR: if (flags & BOINC_DIAG_TRACETOSTDERR) { - n = fprintf(stderr, szMsg); + n = fprintf(stderr, "%s", szMsg); if (n > 0) stderr_file_size += n; } if (flags & BOINC_DIAG_TRACETOSTDOUT) { - n = fprintf(stdout, szMsg); + n = fprintf(stdout, "%s", szMsg); if (n > 0) stdout_file_size += n; }